Menu

#3 Get Bandwidth Usage

open
nobody
None
5
2006-03-27
2006-03-27
No

getFileSizeLimit() return the current filesize limit
getUploadLimit() return the users's upload limit
getUploadedBytes() return the number of bytes
uploaded
getUploadedPercent() return a float with the
percentage of the upload limit already used.

$info = $api->executeMethod
("flickr.people.getUploadStatus",array(),false);

$xml = $info->getXml()->user;
$bandwidthMax = $xml->bandwidth['max'];
$bandwidthUsed = $xml->bandwidth['used'];

$bandwidthLeft = round(($bandwidthMax-
$bandwidthUsed)/1024/1024,2);
$bandwidthPercentageUsed = round(($bandwidthUsed/
$bandwidthMax)*100,2);
$bandwidthPercentageLeft = 100-round(($bandwidthUsed/
$bandwidthMax)*100,2);

Discussion


Log in to post a comment.