The Metrics class provides methods to fetch statistics about videos on your account.
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234")
@events = Sorenson::Services::Metric.all
// authenticate and get an account object
$account = S360_Account::login("username", "password");
// YYYY-MM-DD format
$start_date= "2009-09-01";
$end_date = "2009-09-30";
// get an asset metrics object
$asset_metrics = $account->getAssetMetrics($start_date, $end_date);
echo $asset_metrics->playTotal
try {
// authenticate over ssl connection
Account acct = Account.login("bob", "bob");
//YYYY-MM-DD format
AssetMetrics metrics = acct.getAssetMetrics("2009-09-01", "2009-09-30");
Console.WriteLine("Total number of plays: " + metrics.geTotalPlays());
//...
} catch (Exception ex) {
// handle excpetion
}
try {
// authenticates over ssl connection
Account acct = Account.login("user_name", "password");
//YYYY-MM-DD format
acct.getAssetMetrics("2009-09-01", "2009-09-30");
//...
} catch (ThreeSixtyException e1) {
e1.printStackTrace();
}
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234")
Sorenson::Services::Metric.total_plays
try {
// authenticate over ssl connection
Account acct = Account.login("bob", "bob");
long num_plays = acct.getTotalPlays();
// total number of plays for the given account
Console.WriteLine("Total number of plays: " + num_plays);
//...
} catch (Exception ex) {
// handle excpetion
}
try {
// authenticates over ssl connection
Account acct = Account.login("user_name", "password");
long num_plays = acct.getTotalPlays();
// total number of plays for the given account
...
} catch (ThreeSixtyException e1) {
e1.printStackTrace();
}
@account = Sorenson::Services::Account.login("example@sorensonmedia.com", "sorensonExample", "1234")
Sorenson::Services::Metric.storage_used
// authenticate and get an account object
$account = S360_Account::login("username", "password");
$start_date = "2009-09-01";
$end_Date = "2009-09-30";
// returns floatval for storage used for the given date range
$usedStorage = $account->getStorageUsed($start_date, $end_date);
echo "storage used: " . $usedStorage;
try {
// authenticate over ssl connection
Account acct = Account.login("bob", "bob");
// Date in a YYYY-MM-DD (year-month-day) format
String startDate = "2009-01-25";
String endDate = "2009-10-25";
double storage_per_date = acct.getStorageUsed(startDate, endDate);
//total storage used by the account for the given data range
Console.WriteLine("Storage used for the given date: " + storage_per_date);
//...
} catch (Exception ex) {
// handle excpetion
}
try {
// authenticates over ssl connection
Account acct = Account.login("user_name", "password");
// Date in a YYYY-MM-DD (year-month-day) format
String startDate = "2009-01-25";
String endDate = "2009-10-25";
double storage_per_date = acct.getStorageUsed(startDate, endDate);
//total storage used by the account for the given data range
//...
} catch (ThreeSixtyException e1) {
e1.printStackTrace();
}