";
// echo "
Your browser is: | {$_SERVER['HTTP_USER_AGENT']} |
";
// echo "Your referrer is: | {$_SERVER['HTTP_REFERER']} |
";
// echo "";
// echo "";
// echo "Num | Email | Account ID | Base URI | Size |
";
// get list of accounts and then figure out amount of space used
$query = "select * from user where active = 1 and base_uri <> '' order by account_id desc limit 0";
echo "account_id,CHK,DIR
";
$q_results = mysql_query($query);
$i = 1;
while($results = mysql_fetch_array($q_results)) {
$base_uri = $results['base_uri'];
$account_id = $results['account_id'];
$email = $results['email'];
$ch = curl_init();
$uri_url = "http://webapi.allmydata.com:8123/uri/";
$full_url = $uri_url . urlencode($base_uri) . "?t=manifest";
// echo $full_url;
curl_setopt($ch, CURLOPT_URL, $full_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = curl_exec($ch);
$manifest_array = explode("URI:", $body);
$j = 0;
$CHK_count = 0;
$DIR_count = 0;
while($manifest_line = $manifest_array[$j]) {
//echo '"' . $manifest_line . '"';
if(strstr($manifest_line, "CHK")) {
$CHK_count = $CHK_count + 1;
} else if(strstr($manifest_line, "DIR")) {
$DIR_count = $DIR_count + 1;
}
$j = $j+1;
}
echo $account_id . ",";
echo $CHK_count . ",";
echo $DIR_count;
echo "
";
// $inner_query = "update user set used_quota=" . $size . " where account_id = ". $account_id;
// $results = mysql_query($inner_query);
// echo "" . $i . " | " . $email . " | " . $account_id . " | " . $base_uri . " | " . $size . " |
";
$i = $i + 1;
usleep(500000);
}
// echo "
";
// mysql_close($connect);
?>