Class Zend_Gdata_YouTube

Description

Service class for interacting with the YouTube Data API.

Located in /Gdata/YouTube.php (line 85)

Zend_Gdata_App
   |
   --Zend_Gdata
      |
      --Zend_Gdata_Media
         |
         --Zend_Gdata_YouTube
Class Constant Summary
 ACTIVITY_FEED_URI = 'http://gdata.youtube.com/feeds/api/events'
 AUTH_SERVICE_NAME = 'youtube'
 CLIENTLOGIN_URL = 'https://www.google.com/youtube/accounts/ClientLogin'
 FAVORITES_URI_SUFFIX = 'favorites'
 FRIEND_ACTIVITY_FEED_URI = 'http://gdata.youtube.com/feeds/api/users/default/friendsactivity'
 INBOX_FEED_URI = 'http://gdata.youtube.com/feeds/api/users/default/inbox'
 INBOX_URI_SUFFIX = 'inbox'
 IN_REPLY_TO_SCHEME = 'http://gdata.youtube.com/schemas/2007#in-reply-to'
 PLAYLIST_REL = 'http://gdata.youtube.com/schemas/2007#playlist'
 RELATED_URI_SUFFIX = 'related'
 RESPONSES_URI_SUFFIX = 'responses'
 STANDARD_MOST_VIEWED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed'
 STANDARD_MOST_VIEWED_URI_V2 = 'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed'
 STANDARD_RECENTLY_FEATURED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'
 STANDARD_RECENTLY_FEATURED_URI_V2 = 'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'
 STANDARD_TOP_RATED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'
 STANDARD_TOP_RATED_URI_V2 = 'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'
 STANDARD_WATCH_ON_MOBILE_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'
 STANDARD_WATCH_ON_MOBILE_URI_V2 = 'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'
 UPLOADS_URI_SUFFIX = 'uploads'
 USER_CONTACTS_REL = 'http://gdata.youtube.com/schemas/2007#user.contacts'
 USER_FAVORITES_REL = 'http://gdata.youtube.com/schemas/2007#user.favorites'
 USER_PLAYLISTS_REL = 'http://gdata.youtube.com/schemas/2007#user.playlists'
 USER_SUBSCRIPTIONS_REL = 'http://gdata.youtube.com/schemas/2007#user.subscriptions'
 USER_UPLOADS_REL = 'http://gdata.youtube.com/schemas/2007#user.uploads'
 USER_URI = 'http://gdata.youtube.com/feeds/api/users'
 VIDEO_COMPLAINTS_REL = 'http://gdata.youtube.com/schemas/2007#video.complaints'
 VIDEO_RATINGS_REL = 'http://gdata.youtube.com/schemas/2007#video.ratings'
 VIDEO_RESPONSES_REL = 'http://gdata.youtube.com/schemas/2007#video.responses'
 VIDEO_URI = 'http://gdata.youtube.com/feeds/api/videos'
Variable Summary
 static array $namespaces
Method Summary
 static array parseFormUploadTokenResponse (string $response)
 Zend_Gdata_YouTube_ActivityFeed getActivityForUser ( $username, mixed $usernames)
 Zend_Gdata_YouTube_ContactFeed getContactFeed ([string $user = null], [mixed $location = null])
 array getFormUploadToken (Zend_Gdata_YouTube_VideoEntry $videoEntry, [string $url = 'http://gdata.youtube.com/action/GetUploadToken'])
 Zend_Gdata_YouTube_VideoEntry|null getFullVideoEntry ( $videoId, mixed $videoID)
 Zend_Gdata_YouTube_PlaylistListFeed getPlaylistListFeed ([string $user = null], [mixed $location = null])
 Zend_Gdata_YouTube_VideoFeed getRelatedVideoFeed ([string $videoId = null], [mixed $location = null])
 Zend_Gdata_YouTube_SubscriptionListFeed getSubscriptionFeed ([string $user = null], [mixed $location = null])
 Zend_Gdata_YouTube_VideoFeed getUserFavorites ([string $user = null], [mixed $location = null])
 Zend_Gdata_YouTube_UserProfileEntry getUserProfile ([string $user = null], [mixed $location = null])
 Zend_Gdata_YouTube_VideoFeed getUserUploads ([string $user = null], [mixed $location = null])
 Zend_Gdata_YouTube_CommentFeed getVideoCommentFeed ([string $videoId = null], [mixed $location = null])
 Zend_Gdata_YouTube_VideoEntry getVideoEntry ([mixed $videoId = null], [mixed $location = null], [boolean $fullEntry = false])
 Zend_Gdata_YouTube_VideoFeed getVideoFeed ([mixed $location = null])
 Zend_Gdata_YouTube_VideoFeed getVideoResponseFeed ([string $videoId = null], [mixed $location = null])
 A replyToCommentEntry ($commentEntry $commentEntry, $commentText $commentText)
 Zend_Gdata_YouTube_InboxEntry|null sendVideoMessage (string $body, [Zend_Gdata_YouTube_VideoEntry $videoEntry = null], [string $videoId = null], string $recipientUserName)
 Zend_Gdata_App setHttpClient (Zend_Http_Client $client, [ $applicationId = 'MyCompany-MyApp-1.0'], [ $clientId = null], [ $developerKey = null])
 Zend_Gdata_YouTube __construct ([Zend_Http_Client $client = null], [string $applicationId = 'MyCompany-MyApp-1.0'], [string $clientId = null], [string $developerKey = null])
Variables
static array $namespaces = array(
array('yt', 'http://gdata.youtube.com/schemas/2007', 1, 0),array('georss','http://www.georss.org/georss',1,0),array('gml','http://www.opengis.net/gml',1,0),array('media','http://search.yahoo.com/mrss/',1,0))
(line 185)

Namespaces used for Zend_Gdata_YouTube

  • access: public

Redefinition of:
Zend_Gdata_Media::$namespaces
Namespaces used for Zend_Gdata_Photos

Inherited Variables

Inherited from Zend_Gdata

Zend_Gdata::$_defaultPostUri
Zend_Gdata::$_httpClient
Zend_Gdata::$_registeredPackages
Zend_Gdata::$_staticHttpClient

Inherited from Zend_Gdata_App

Zend_Gdata_App::$_gzipEnabled
Zend_Gdata_App::$_httpMethodOverride
Zend_Gdata_App::$_majorProtocolVersion
Zend_Gdata_App::$_maxRedirects
Zend_Gdata_App::$_minorProtocolVersion
Zend_Gdata_App::$_useObjectMapping
Zend_Gdata_App::$_verboseExceptionMessages
Methods
static parseFormUploadTokenResponse (line 650)

Helper function for parsing a YouTube token response

  • return: An array containing the token and URL
  • throws: Zend_Gdata_App_Exception
  • access: public
static array parseFormUploadTokenResponse (string $response)
  • string $response: The service response
getActivityForUser (line 722)

Retrieves the activity feed for users

  • throws: Zend_Gdata_App_VersionException if using version less than 2.
  • access: public
Zend_Gdata_YouTube_ActivityFeed getActivityForUser ( $username, mixed $usernames)
  • mixed $usernames: A string identifying the usernames for which to retrieve activity for. This can also be a Zend_Gdata_Query object from which a URL can be determined.
  • $username
getContactFeed (line 569)

Retrieves a feed of a user's contacts

  • return: The feed of contacts
  • access: public
Zend_Gdata_YouTube_ContactFeed getContactFeed ([string $user = null], [mixed $location = null])
  • string $user: (optional) The username of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getFormUploadToken (line 699)

Retrieves a YouTube token

  • return: An array containing a token and URL
  • throws: Zend_Gdata_App_Exception
  • access: public
array getFormUploadToken (Zend_Gdata_YouTube_VideoEntry $videoEntry, [string $url = 'http://gdata.youtube.com/action/GetUploadToken'])
getFriendActivityForCurrentUser (line 753)

Retrieve the activity of the currently authenticated users friend.

  • throws: Zend_Gdata_App_Exception if not logged in.
  • access: public
Zend_Gdata_YouTube_ActivityFeed getFriendActivityForCurrentUser ()
getFullVideoEntry (line 305)

Retrieves a video entry from the user's upload feed.

  • return: The video entry to be retrieved, or null if it was not found or the user requesting it did not have the appropriate permissions.
  • throws: Zend_Gdata_App_HttpException
  • access: public
Zend_Gdata_YouTube_VideoEntry|null getFullVideoEntry ( $videoId, mixed $videoID)
  • mixed $videoID: The ID of the video to retrieve.
  • $videoId
getInboxFeedForCurrentUser (line 771)

Retrieve a feed of messages in the currently authenticated user's inbox.

  • throws: Zend_Gdata_App_Exception if not logged in.
  • access: public
Zend_Gdata_YouTube_InboxFeed|null getInboxFeedForCurrentUser ()
getMostViewedVideoFeed (line 417)

Retrieves a feed of the most viewed videos.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_VideoFeed getMostViewedVideoFeed ([mixed $location = null])
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getPlaylistListFeed (line 511)

Retrieves a feed which lists a user's playlist

  • return: The feed of playlists
  • access: public
Zend_Gdata_YouTube_PlaylistListFeed getPlaylistListFeed ([string $user = null], [mixed $location = null])
  • string $user: (optional) The username of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getPlaylistVideoFeed (line 531)

Retrieves a feed of videos in a particular playlist

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_PlaylistVideoFeed getPlaylistVideoFeed (mixed $location)
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getRecentlyFeaturedVideoFeed (line 448)

Retrieves a feed of recently featured videos.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_VideoFeed getRecentlyFeaturedVideoFeed ([mixed $location = null])
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getRelatedVideoFeed (line 321)

Retrieves a feed of videos related to the specified video ID.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_VideoFeed getRelatedVideoFeed ([string $videoId = null], [mixed $location = null])
  • string $videoId: The videoId of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getSubscriptionFeed (line 549)

Retrieves a feed of a user's subscriptions

  • return: The feed of subscriptions
  • access: public
Zend_Gdata_YouTube_SubscriptionListFeed getSubscriptionFeed ([string $user = null], [mixed $location = null])
  • string $user: (optional) The username of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getTopRatedVideoFeed (line 385)

Retrieves a feed of comments related to the specified video ID.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_CommentFeed getTopRatedVideoFeed ([mixed $location = null])
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getUserFavorites (line 610)

Retrieves a user's favorites

  • return: The videos favorited by the user
  • access: public
Zend_Gdata_YouTube_VideoFeed getUserFavorites ([string $user = null], [mixed $location = null])
  • string $user: (optional) The username of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getUserProfile (line 631)

Retrieves a user's profile as an entry

  • return: The user profile entry
  • access: public
Zend_Gdata_YouTube_UserProfileEntry getUserProfile ([string $user = null], [mixed $location = null])
  • string $user: (optional) The username of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getUserUploads (line 589)

Retrieves a user's uploads

  • return: The videos uploaded by the user
  • access: public
Zend_Gdata_YouTube_VideoFeed getUserUploads ([string $user = null], [mixed $location = null])
  • string $user: (optional) The username of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getVideoCommentFeed (line 365)

Retrieves a feed of comments related to the specified video ID.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_CommentFeed getVideoCommentFeed ([string $videoId = null], [mixed $location = null])
  • string $videoId: The videoId of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getVideoEntry (line 279)

Retrieves a specific video entry.

  • return: The video entry found at the specified URL.
  • throws: Zend_Gdata_App_HttpException
  • access: public
Zend_Gdata_YouTube_VideoEntry getVideoEntry ([mixed $videoId = null], [mixed $location = null], [boolean $fullEntry = false])
  • mixed $videoId: The ID of the video to retrieve.
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined.
  • boolean $fullEntry: (optional) Retrieve the full metadata for the entry. Only possible if entry belongs to currently authenticated user. An exception will be thrown otherwise.
getVideoFeed (line 254)

Retrieves a feed of videos.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_VideoFeed getVideoFeed ([mixed $location = null])
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getVideoResponseFeed (line 343)

Retrieves a feed of video responses related to the specified video ID.

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_VideoFeed getVideoResponseFeed ([string $videoId = null], [mixed $location = null])
  • string $videoId: The videoId of interest
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
getWatchOnMobileVideoFeed (line 480)

Retrieves a feed of videos recently featured for mobile devices.

These videos will have RTSP links in the $entry->mediaGroup->content

  • return: The feed of videos found at the specified URL.
  • access: public
Zend_Gdata_YouTube_VideoFeed getWatchOnMobileVideoFeed ([mixed $location = null])
  • mixed $location: (optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
replyToCommentEntry (line 853)

Post a comment in reply to an existing comment

  • return: Zend_Gdata_YouTube_CommentEntry representing the posted comment
  • access: public
A replyToCommentEntry ($commentEntry $commentEntry, $commentText $commentText)
  • $commentEntry $commentEntry: Zend_Gdata_YouTube_CommentEntry The comment entry to reply to
  • $commentText $commentText: string The text of the comment to post
sendVideoMessage (line 800)

Send a video message.

Note: Either a Zend_Gdata_YouTube_VideoEntry or a valid video ID must be provided.

  • return: The Zend_Gdata_YouTube_Inbox_Entry representing the sent message.
  • throws: Zend_Gdata_App_InvalidArgumentException if no valid Zend_Gdata_YouTube_VideoEntry or videoId were provided
  • access: public
Zend_Gdata_YouTube_InboxEntry|null sendVideoMessage (string $body, [Zend_Gdata_YouTube_VideoEntry $videoEntry = null], [string $videoId = null], string $recipientUserName)
  • string $body: The body of the message
  • string $videoId: The id of the video to send
  • string $recipientUserName: The username of the recipient
  • Zend_Gdata_YouTube_VideoEntry $videoEntry: (optional) The video entry to send
setHttpClient (line 222)

Set the Zend_Http_Client object used for communication

  • return: Provides a fluent interface
  • throws: Zend_Gdata_App_HttpException
  • access: public
Zend_Gdata_App setHttpClient (Zend_Http_Client $client, [ $applicationId = 'MyCompany-MyApp-1.0'], [ $clientId = null], [ $developerKey = null])
  • Zend_Http_Client $client: The client to use for communication
  • $applicationId
  • $clientId
  • $developerKey

Redefinition of:
Zend_Gdata_App::setHttpClient()
Set the Zend_Http_Client object used for communication
Constructor __construct (line 202)

Create Zend_Gdata_YouTube object

  • access: public
Zend_Gdata_YouTube __construct ([Zend_Http_Client $client = null], [string $applicationId = 'MyCompany-MyApp-1.0'], [string $clientId = null], [string $developerKey = null])
  • Zend_Http_Client $client: (optional) The HTTP client to use when when communicating with the Google servers.
  • string $applicationId: The identity of the app in the form of Company-AppName-Version
  • string $clientId: The clientId issued by the YouTube dashboard
  • string $developerKey: The developerKey issued by the YouTube dashboard

Redefinition of:
Zend_Gdata_Media::__construct()
Create Gdata_Media object

Inherited Methods

Inherited From Zend_Gdata_Media

 Zend_Gdata_Media::__construct()

Inherited From Zend_Gdata

 Zend_Gdata::__construct()
 Zend_Gdata::getEntry()
 Zend_Gdata::getFeed()
 Zend_Gdata::import()
 Zend_Gdata::isAuthenticated()
 Zend_Gdata::performHttpRequest()

Inherited From Zend_Gdata_App

 Zend_Gdata_App::__construct()
 Zend_Gdata_App::delete()
 Zend_Gdata_App::enableRequestDebugLogging()
 Zend_Gdata_App::generateIfMatchHeaderData()
 Zend_Gdata_App::get()
 Zend_Gdata_App::getEntry()
 Zend_Gdata_App::getFeed()
 Zend_Gdata_App::getGzipEnabled()
 Zend_Gdata_App::getHttpClient()
 Zend_Gdata_App::getHttpMethodOverride()
 Zend_Gdata_App::getMajorProtocolVersion()
 Zend_Gdata_App::getMaxRedirects()
 Zend_Gdata_App::getMinorProtocolVersion()
 Zend_Gdata_App::getNextFeed()
 Zend_Gdata_App::getPreviousFeed()
 Zend_Gdata_App::getStaticHttpClient()
 Zend_Gdata_App::getVerboseExceptionMessages()
 Zend_Gdata_App::import()
 Zend_Gdata_App::importFile()
 Zend_Gdata_App::importString()
 Zend_Gdata_App::importUrl()
 Zend_Gdata_App::insertEntry()
 Zend_Gdata_App::performHttpRequest()
 Zend_Gdata_App::post()
 Zend_Gdata_App::prepareRequest()
 Zend_Gdata_App::put()
 Zend_Gdata_App::registerPackage()
 Zend_Gdata_App::retrieveAllEntriesForFeed()
 Zend_Gdata_App::setGzipEnabled()
 Zend_Gdata_App::setHttpClient()
 Zend_Gdata_App::setHttpMethodOverride()
 Zend_Gdata_App::setMajorProtocolVersion()
 Zend_Gdata_App::setMaxRedirects()
 Zend_Gdata_App::setMinorProtocolVersion()
 Zend_Gdata_App::setStaticHttpClient()
 Zend_Gdata_App::setVerboseExceptionMessages()
 Zend_Gdata_App::updateEntry()
 Zend_Gdata_App::useObjectMapping()
 Zend_Gdata_App::usingObjectMapping()
 Zend_Gdata_App::__call()
Class Constants
ACTIVITY_FEED_MAX_USERS = 20 (line 143)

The maximum number of users for which activity can be requested for, as enforced by the API.

ACTIVITY_FEED_URI = 'http://gdata.youtube.com/feeds/api/events' (line 116)
AUTH_SERVICE_NAME = 'youtube' (line 88)
CLIENTLOGIN_URL = 'https://www.google.com/youtube/accounts/ClientLogin' (line 89)
FAVORITES_URI_SUFFIX = 'favorites' (line 150)

The suffix for a feed of favorites.

FRIEND_ACTIVITY_FEED_URI =
'http://gdata.youtube.com/feeds/api/users/default/friendsactivity'
(line 117)
INBOX_FEED_URI =
'http://gdata.youtube.com/feeds/api/users/default/inbox'
(line 134)

The URI of the inbox feed for the currently authenticated user.

INBOX_URI_SUFFIX = 'inbox' (line 178)

The suffix for a feed of messages (inbox entries).

IN_REPLY_TO_SCHEME =
'http://gdata.youtube.com/schemas/2007#in-reply-to'
(line 126)

The URI of the in-reply-to schema for comments in reply to other comments.

PLAYLIST_REL = 'http://gdata.youtube.com/schemas/2007#playlist' (line 107)
RELATED_URI_SUFFIX = 'related' (line 171)

The suffix for a feed of related videos.

RESPONSES_URI_SUFFIX = 'responses' (line 164)

The suffix for a feed of video responses.

STANDARD_MOST_VIEWED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed' (line 92)
STANDARD_MOST_VIEWED_URI_V2 =
'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed'
(line 98)
STANDARD_RECENTLY_FEATURED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured' (line 93)
STANDARD_RECENTLY_FEATURED_URI_V2 =
'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'
(line 100)
STANDARD_TOP_RATED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated' (line 91)
STANDARD_TOP_RATED_URI_V2 =
'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'
(line 96)
STANDARD_WATCH_ON_MOBILE_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile' (line 94)
STANDARD_WATCH_ON_MOBILE_URI_V2 =
'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'
(line 102)
UPLOADS_URI_SUFFIX = 'uploads' (line 157)

The suffix for the user's upload feed.

USER_CONTACTS_REL = 'http://gdata.youtube.com/schemas/2007#user.contacts' (line 111)
USER_FAVORITES_REL = 'http://gdata.youtube.com/schemas/2007#user.favorites' (line 112)
USER_PLAYLISTS_REL = 'http://gdata.youtube.com/schemas/2007#user.playlists' (line 109)
USER_SUBSCRIPTIONS_REL = 'http://gdata.youtube.com/schemas/2007#user.subscriptions' (line 110)
USER_UPLOADS_REL = 'http://gdata.youtube.com/schemas/2007#user.uploads' (line 108)
USER_URI = 'http://gdata.youtube.com/feeds/api/users' (line 105)
VIDEO_COMPLAINTS_REL = 'http://gdata.youtube.com/schemas/2007#video.complaints' (line 115)
VIDEO_RATINGS_REL = 'http://gdata.youtube.com/schemas/2007#video.ratings' (line 114)
VIDEO_RESPONSES_REL = 'http://gdata.youtube.com/schemas/2007#video.responses' (line 113)
VIDEO_URI = 'http://gdata.youtube.com/feeds/api/videos' (line 106)

Inherited Constants

Inherited from Zend_Gdata

Zend_Gdata::AUTH_SERVICE_NAME

Inherited from Zend_Gdata_App

Zend_Gdata_App::DEFAULT_MAJOR_PROTOCOL_VERSION
Zend_Gdata_App::DEFAULT_MINOR_PROTOCOL_VERSION

Documentation generated on Mon, 21 Jun 2010 15:53:31 -0400 by phpDocumentor 1.4.3