Created
February 10, 2011 04:59
-
-
Save rickfillion/819975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$host="https://bodega.fogbugz.com/api.asp"; | |
$user="rick@madefresh.ca"; | |
$password = "********"; | |
$query = 'project:"Bodega Application" milestone:"1.4.0" status:"Active"'; | |
$cols = "ixBug"; | |
$tokenCommand = "curl \"$host?cmd=logon&email=$user&password=$password\" | perl -ne 'print if s/.*\\[CDATA\[(.*)\\]\\].*/\\1/'"; | |
$token = shell_exec($tokenCommand); | |
$query = urlencode($query); | |
$queryCommand = "curl \"$host?cmd=search&q=$query&cols=$cols&token=$token\""; | |
$queryResult = shell_exec($queryCommand); | |
$regex = "/cases count=\"(\d+)\"/"; | |
preg_match($regex, $queryResult, $matches, PREG_OFFSET_CAPTURE); | |
$totalCount = $matches[1][0]; | |
echo "<?xml version='1.0' encoding='UTF-8'?>\n"; | |
?> | |
<root> | |
<item> | |
<value><?= $totalCount?></value> | |
<text></text> | |
</item> | |
</root> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment