本文整理汇总了PHP中Zend_Gdata_YouTube::getActivityForUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_YouTube::getActivityForUser方法的具体用法?PHP Zend_Gdata_YouTube::getActivityForUser怎么用?PHP Zend_Gdata_YouTube::getActivityForUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata_YouTube
的用法示例。
在下文中一共展示了Zend_Gdata_YouTube::getActivityForUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getActivitiesByUser
/**
* get activities by a user
* @param username
* @return Zend_Gdata_YouTube_ActivityFeed
*/
public function getActivitiesByUser($user)
{
/* @var $ytq Zend_Gdata_YouTube_VideoQuery */
//$ytq = $this->yt->newQuery(Zend_Gdata_YouTube::ACTIVITY_FEED_URI . '?author=' . $user);
//$ytq->setStartIndex($page * self::ITEMS_PER_PAGE);
//$ytq->setMaxResults(self::ITEMS_PER_PAGE);
return $this->yt->getActivityForUser($user);
}
示例2: testThrowExceptionOnActivityFeedRequestForMoreThan20Users
public function testThrowExceptionOnActivityFeedRequestForMoreThan20Users()
{
$exceptionThrown = false;
$listOfMoreThan20Users = null;
$youtube = new Zend_Gdata_YouTube();
$youtube->setMajorProtocolVersion(2);
for ($x = 0; $x < 30; $x++) {
$listOfMoreThan20Users .= "user{$x}";
if ($x != 29) {
$listOfMoreThan20Users .= ",";
}
}
try {
$youtube->getActivityForUser($listOfMoreThan20Users);
} catch (Zend_Gdata_App_InvalidArgumentException $e) {
$exceptionThrown = true;
}
$this->assertTrue($exceptionThrown, 'Was expecting an exception on ' . 'a request to ->getActivityForUser when more than 20 users were ' . 'specified in YouTube.php');
}