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


PHP Zend_Gdata_YouTube::newDescription方法代码示例

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


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

示例1: create_container

 /**
  *
  * @param  string                       $container_type
  * @param  Request                      $request
  * @return Bridge_Api_Youtube_Container
  */
 public function create_container($container_type, Request $request)
 {
     switch ($container_type) {
         case self::CONTAINER_TYPE_PLAYLIST:
             $container_desc = $request->get('f_container_description');
             $container_title = $request->get('f_container_title');
             $new_playlist = $this->_api->newPlaylistListEntry();
             if (trim($container_desc) !== '') {
                 $new_playlist->description = $this->_api->newDescription()->setText($container_desc);
             }
             $new_playlist->title = $this->_api->newTitle()->setText($container_title);
             $post_location = 'http://gdata.youtube.com/feeds/api/users/default/playlists';
             $entry = $this->_api->insertEntry($new_playlist, $post_location);
             return new Bridge_Api_Youtube_Container($entry, $container_type, null);
             break;
         default:
             throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type);
             break;
     }
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:26,代码来源:Youtube.php

示例2: createPlaylist

/**
 * Create a new playlist for the currently authenticated user
 *
 * @param string $playlistTitle Title of the new playlist
 * @param string $playlistDescription Description for the new playlist
 * @return void
 */
function createPlaylist($playlistTitle, $playlistDescription)
{
    $httpClient = getAuthSubHttpClient();
    $youTubeService = new Zend_Gdata_YouTube($httpClient);
    $feed = $youTubeService->getPlaylistListFeed('default');
    if (loggingEnabled()) {
        logMessage($httpClient->getLastRequest(), 'request');
        logMessage($httpClient->getLastResponse()->getBody(), 'response');
    }
    $newPlaylist = $youTubeService->newPlaylistListEntry();
    $newPlaylist->description = $youTubeService->newDescription()->setText($playlistDescription);
    $newPlaylist->title = $youTubeService->newTitle()->setText($playlistDescription);
    if (!$feed instanceof Zend_Gdata_YouTube_PlaylistListFeed) {
        print 'ERROR - Could not retrieve playlists<br />' . printCacheWarning();
        return;
    }
    $playlistFeedUrl = 'http://gdata.youtube.com/feeds/users/default/playlists';
    try {
        $updatedEntry = $youTubeService->insertEntry($newPlaylist, $playlistFeedUrl);
        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 create new playlist: ' . $e->getMessage();
        return;
    }
    print 'Playlist added succesfully.<br /><a href="#" onclick="' . 'ytVideoApp.retrievePlaylists();"' . '">(refresh your playlist listing)</a><br />' . printCacheWarning();
}
开发者ID:holdensmagicalunicorn,项目名称:copperFramework,代码行数:39,代码来源:operations.php


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