当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata_YouTube::getPlaylistListFeed方法代码示例

本文整理汇总了PHP中Zend_Gdata_YouTube::getPlaylistListFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_YouTube::getPlaylistListFeed方法的具体用法?PHP Zend_Gdata_YouTube::getPlaylistListFeed怎么用?PHP Zend_Gdata_YouTube::getPlaylistListFeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Gdata_YouTube的用法示例。


在下文中一共展示了Zend_Gdata_YouTube::getPlaylistListFeed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_PlaylistEntry_from_Id

 /**
  *
  * @param  string                              $element_id
  * @return Zend_Gdata_YouTube_PlaylistListFeed
  */
 protected function get_PlaylistEntry_from_Id($element_id)
 {
     foreach ($this->_api->getPlaylistListFeed('default') as $playlist_entry) {
         if ($element_id == $playlist_entry->getPlaylistId()->getText()) {
             return $playlist_entry;
         }
     }
     return null;
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:14,代码来源:Youtube.php

示例2: getPlaylistsByUser

 /**
  * get playlists by a user
  * @param username
  * @return Zend_Gdata_YouTube_PlaylistListFeed
  */
 public function getPlaylistsByUser($user, $page = 0)
 {
     /* @var $ytq Zend_Gdata_YouTube_VideoQuery */
     $ytq = $this->yt->newVideoQuery(Zend_Gdata_YouTube::USER_URI . '/' . $user . '/playlists');
     $page = $page * self::ITEMS_PER_PAGE;
     $ytq->setStartIndex($page == 0 ? $page : $page + 1);
     $ytq->setMaxResults(self::ITEMS_PER_PAGE);
     $ytq->setOrderBy('published');
     return $this->yt->getPlaylistListFeed(null, $ytq);
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:15,代码来源:Youtube.php

示例3: testAddUpdateAndDeletePlaylistV2

 public function testAddUpdateAndDeletePlaylistV2()
 {
     $service = Zend_Gdata_YouTube::AUTH_SERVICE_NAME;
     $authenticationURL = 'https://www.google.com/youtube/accounts/ClientLogin';
     $httpClient = Zend_Gdata_ClientLogin::getHttpClient($username = $this->user, $password = $this->pass, $service = $service, $client = null, $source = 'Google-UnitTests-1.0', $loginToken = null, $loginCaptcha = null, $authenticationURL);
     $yt = new Zend_Gdata_YouTube($httpClient, 'Google-UnitTests-1.0', 'ytapi-gdataops-12345-u78960r7-0', 'AI39si6c-ZMGFZ5fkDAEJoCNHP9LOM2LSO1XuycZF7E' . 'yu1IuvkioESqzRcf3voDLymIUGIrxdMx2aTufdbf5D7E51NyLYyfeaw');
     $yt->setMajorProtocolVersion(2);
     $feed = $yt->getPlaylistListFeed($this->ytAccount);
     // Add new
     $newPlaylist = $yt->newPlaylistListEntry();
     $newPlaylist->setMajorProtocolVersion(2);
     $titleString = $this->generateRandomString(10);
     $newPlaylist->title = $yt->newTitle()->setText($titleString);
     $newPlaylist->summary = $yt->newSummary()->setText('testing');
     $postUrl = 'http://gdata.youtube.com/feeds/api/users/default/playlists';
     $successfulInsertion = true;
     try {
         $yt->insertEntry($newPlaylist, $postUrl);
     } catch (Zend_Gdata_App_Exception $e) {
         $successfulInsertion = false;
     }
     $this->assertTrue($successfulInsertion, 'Failed to insert a new ' . 'playlist.');
     $playlistListFeed = $yt->getPlaylistListFeed('default');
     $playlistFound = false;
     $newPlaylistEntry = null;
     foreach ($playlistListFeed as $playlistListEntry) {
         if ($playlistListEntry->title->text == $titleString) {
             $playlistFound = true;
             $newPlaylistEntry = $playlistListEntry;
             break;
         }
     }
     $this->assertTrue($playlistFound, 'Could not find the newly inserted ' . 'playlist.');
     // Update it
     $newTitle = $this->generateRandomString(10);
     $newPlaylistEntry->title->setText($newTitle);
     $updatedSuccesfully = true;
     try {
         $newPlaylistEntry->save();
     } catch (Zend_Gdata_App_Exception $e) {
         $updatedSuccesfully = false;
     }
     $this->assertTrue($updatedSuccesfully, 'Could not succesfully update ' . 'a new playlist.');
     // Delete it
     $deletedSuccesfully = true;
     try {
         $newPlaylistEntry->delete();
     } catch (Zend_Gdata_App_Exception $e) {
         $deletedSuccesfully = false;
     }
     $this->assertTrue($deletedSuccesfully, 'Could not succesfully delete ' . 'a new playlist.');
 }
开发者ID:netvlies,项目名称:zf,代码行数:52,代码来源:YouTubeOnlineTest.php

示例4: updatePlaylist

/**
 * Delete a playlist
 *
 * @param string $newplaylistTitle New title for the playlist to be updated
 * @param string $newPlaylistDescription New description for the playlist to be updated
 * @param string $oldPlaylistTitle Title of the playlist to be updated
 * @return void
 */
function updatePlaylist($newPlaylistTitle, $newPlaylistDescription, $oldPlaylistTitle)
{
    $httpClient = getAuthSubHttpClient();
    $youTubeService = new Zend_Gdata_YouTube($httpClient);
    $feed = $youTubeService->getPlaylistListFeed('default');
    if (loggingEnabled()) {
        logMessage($httpClient->getLastRequest(), 'request');
        logMessage($httpClient->getLastResponse()->getBody(), 'response');
    }
    $playlistEntryToDelete = null;
    foreach ($feed as $playlistEntry) {
        if ($playlistEntry->getTitleValue() == $oldplaylistTitle) {
            $playlistEntryToDelete = $playlistEntry;
            break;
        }
    }
    if (!$playlistEntryToDelete instanceof Zend_Gdata_YouTube_PlaylistListEntry) {
        print 'ERROR - Could not retrieve playlist to be updated<br />' . printCacheWarning();
        return;
    }
    try {
        $response = $playlistEntryToDelete->delete();
        if (loggingEnabled()) {
            logMessage($httpClient->getLastRequest(), 'request');
            logMessage($httpClient->getLastResponse()->getBody(), 'response');
        }
    } catch (Zend_Gdata_App_HttpException $httpException) {
        print 'ERROR ' . $httpException->getMessage() . ' HTTP details<br /><textarea cols="100" rows="20">' . $httpException->getRawResponseBody() . '</textarea><br />' . '<a href="session_details.php">' . 'click here to view details of last request</a><br />';
        return;
    } catch (Zend_Gdata_App_Exception $e) {
        print 'ERROR - Could not delete the playlist: ' . $e->getMessage();
        return;
    }
    print 'Playlist deleted succesfully.<br /><a href="#" onclick="' . 'ytVideoApp.retrievePlaylists();"' . '">(refresh your playlist listing)</a><br />' . printCacheWarning();
}
开发者ID:holdensmagicalunicorn,项目名称:copperFramework,代码行数:43,代码来源:operations.php


注:本文中的Zend_Gdata_YouTube::getPlaylistListFeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。