Moodle  2.2.1
http://www.collinsharper.com
Zend_Gdata_YouTube Class Reference
Inheritance diagram for Zend_Gdata_YouTube:
Collaboration diagram for Zend_Gdata_YouTube:

Public Member Functions

 __construct ($client=null, $applicationId= 'MyCompany-MyApp-1.0', $clientId=null, $developerKey=null)
 setHttpClient ($client, $applicationId= 'MyCompany-MyApp-1.0', $clientId=null, $developerKey=null)
 getVideoFeed ($location=null)
 getVideoEntry ($videoId=null, $location=null, $fullEntry=false)
 getFullVideoEntry ($videoId)
 getRelatedVideoFeed ($videoId=null, $location=null)
 getVideoResponseFeed ($videoId=null, $location=null)
 getVideoCommentFeed ($videoId=null, $location=null)
 getTopRatedVideoFeed ($location=null)
 getMostViewedVideoFeed ($location=null)
 getRecentlyFeaturedVideoFeed ($location=null)
 getWatchOnMobileVideoFeed ($location=null)
 getPlaylistListFeed ($user=null, $location=null)
 getPlaylistVideoFeed ($location)
 getSubscriptionFeed ($user=null, $location=null)
 getContactFeed ($user=null, $location=null)
 getUserUploads ($user=null, $location=null)
 getUserFavorites ($user=null, $location=null)
 getUserProfile ($user=null, $location=null)
 getFormUploadToken ($videoEntry, $url='http://gdata.youtube.com/action/GetUploadToken')
 getActivityForUser ($username)
 getFriendActivityForCurrentUser ()
 getInboxFeedForCurrentUser ()
 sendVideoMessage ($body, $videoEntry=null, $videoId=null, $recipientUserName)
 replyToCommentEntry ($commentEntry, $commentText)

Static Public Member Functions

static parseFormUploadTokenResponse ($response)

Data Fields

const AUTH_SERVICE_NAME = 'youtube'
const CLIENTLOGIN_URL = 'https://www.google.com/youtube/accounts/ClientLogin'
const STANDARD_TOP_RATED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'
const STANDARD_MOST_VIEWED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed'
const STANDARD_RECENTLY_FEATURED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'
const STANDARD_WATCH_ON_MOBILE_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'
const STANDARD_TOP_RATED_URI_V2
const STANDARD_MOST_VIEWED_URI_V2
const STANDARD_RECENTLY_FEATURED_URI_V2
const STANDARD_WATCH_ON_MOBILE_URI_V2
const USER_URI = 'http://gdata.youtube.com/feeds/api/users'
const VIDEO_URI = 'http://gdata.youtube.com/feeds/api/videos'
const PLAYLIST_REL = 'http://gdata.youtube.com/schemas/2007#playlist'
const USER_UPLOADS_REL = 'http://gdata.youtube.com/schemas/2007#user.uploads'
const USER_PLAYLISTS_REL = 'http://gdata.youtube.com/schemas/2007#user.playlists'
const USER_SUBSCRIPTIONS_REL = 'http://gdata.youtube.com/schemas/2007#user.subscriptions'
const USER_CONTACTS_REL = 'http://gdata.youtube.com/schemas/2007#user.contacts'
const USER_FAVORITES_REL = 'http://gdata.youtube.com/schemas/2007#user.favorites'
const VIDEO_RESPONSES_REL = 'http://gdata.youtube.com/schemas/2007#video.responses'
const VIDEO_RATINGS_REL = 'http://gdata.youtube.com/schemas/2007#video.ratings'
const VIDEO_COMPLAINTS_REL = 'http://gdata.youtube.com/schemas/2007#video.complaints'
const ACTIVITY_FEED_URI = 'http://gdata.youtube.com/feeds/api/events'
const FRIEND_ACTIVITY_FEED_URI
const IN_REPLY_TO_SCHEME
const INBOX_FEED_URI
const ACTIVITY_FEED_MAX_USERS = 20
const FAVORITES_URI_SUFFIX = 'favorites'
const UPLOADS_URI_SUFFIX = 'uploads'
const RESPONSES_URI_SUFFIX = 'responses'
const RELATED_URI_SUFFIX = 'related'
const INBOX_URI_SUFFIX = 'inbox'

Static Public Attributes

static $namespaces

Detailed Description

Definition at line 85 of file YouTube.php.


Constructor & Destructor Documentation

__construct ( client = null,
applicationId = 'MyCompany-MyApp-1.0',
clientId = null,
developerKey = null 
)

Create Zend_Gdata_YouTube object

Parameters:
Zend_Http_Client$client(optional) The HTTP client to use when when communicating with the Google servers.
string$applicationIdThe identity of the app in the form of Company-AppName-Version
string$clientIdThe clientId issued by the YouTube dashboard
string$developerKeyThe developerKey issued by the YouTube dashboard

Definition at line 202 of file YouTube.php.

Here is the call graph for this function:


Member Function Documentation

getActivityForUser ( username)

Retrieves the activity feed for users

Parameters:
mixed$usernamesA 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.
Exceptions:
Zend_Gdata_App_VersionExceptionif using version less than 2.
Returns:
Zend_Gdata_YouTube_ActivityFeed

Definition at line 722 of file YouTube.php.

Here is the call graph for this function:

getContactFeed ( user = null,
location = null 
)

Retrieves a feed of a user's contacts

Parameters:
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
Returns:
Zend_Gdata_YouTube_ContactFeed The feed of contacts

Definition at line 569 of file YouTube.php.

Here is the call graph for this function:

getFormUploadToken ( videoEntry,
url = 'http://gdata.youtube.com/action/GetUploadToken' 
)

Retrieves a YouTube token

Parameters:
Zend_Gdata_YouTube_VideoEntry$videoEntryThe video entry
string$urlThe location as a string URL
Exceptions:
Zend_Gdata_App_Exception
Returns:
array An array containing a token and URL

Definition at line 699 of file YouTube.php.

Here is the call graph for this function:

Retrieve the activity of the currently authenticated users friend.

Exceptions:
Zend_Gdata_App_Exceptionif not logged in.
Returns:
Zend_Gdata_YouTube_ActivityFeed

Definition at line 753 of file YouTube.php.

Here is the call graph for this function:

getFullVideoEntry ( videoId)

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

Parameters:
mixed$videoIDThe ID of the video to retrieve.
Exceptions:
Zend_Gdata_App_HttpException
Returns:
Zend_Gdata_YouTube_VideoEntry|null The video entry to be retrieved, or null if it was not found or the user requesting it did not have the appropriate permissions.

Definition at line 305 of file YouTube.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Exceptions:
Zend_Gdata_App_Exceptionif not logged in.
Returns:
Zend_Gdata_YouTube_InboxFeed|null

Definition at line 771 of file YouTube.php.

Here is the call graph for this function:

getMostViewedVideoFeed ( location = null)

Retrieves a feed of the most viewed videos.

Parameters:
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_VideoFeed The feed of videos found at the specified URL.

Definition at line 417 of file YouTube.php.

Here is the call graph for this function:

getPlaylistListFeed ( user = null,
location = null 
)

Retrieves a feed which lists a user's playlist

Parameters:
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
Returns:
Zend_Gdata_YouTube_PlaylistListFeed The feed of playlists

Definition at line 511 of file YouTube.php.

Here is the call graph for this function:

getPlaylistVideoFeed ( location)

Retrieves a feed of videos in a particular playlist

Parameters:
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_PlaylistVideoFeed The feed of videos found at the specified URL.

Definition at line 531 of file YouTube.php.

Here is the call graph for this function:

getRecentlyFeaturedVideoFeed ( location = null)

Retrieves a feed of recently featured videos.

Parameters:
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_VideoFeed The feed of videos found at the specified URL.

Definition at line 448 of file YouTube.php.

Here is the call graph for this function:

getRelatedVideoFeed ( videoId = null,
location = null 
)

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

Parameters:
string$videoIdThe videoId of interest
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_VideoFeed The feed of videos found at the specified URL.

Definition at line 321 of file YouTube.php.

Here is the call graph for this function:

getSubscriptionFeed ( user = null,
location = null 
)

Retrieves a feed of a user's subscriptions

Parameters:
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
Returns:
Zend_Gdata_YouTube_SubscriptionListFeed The feed of subscriptions

Definition at line 549 of file YouTube.php.

Here is the call graph for this function:

getTopRatedVideoFeed ( location = null)

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

Parameters:
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_CommentFeed The feed of videos found at the specified URL.

Definition at line 385 of file YouTube.php.

Here is the call graph for this function:

getUserFavorites ( user = null,
location = null 
)

Retrieves a user's favorites

Parameters:
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
Returns:
Zend_Gdata_YouTube_VideoFeed The videos favorited by the user

Definition at line 610 of file YouTube.php.

Here is the call graph for this function:

getUserProfile ( user = null,
location = null 
)

Retrieves a user's profile as an entry

Parameters:
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
Returns:
Zend_Gdata_YouTube_UserProfileEntry The user profile entry

Definition at line 631 of file YouTube.php.

Here is the call graph for this function:

getUserUploads ( user = null,
location = null 
)

Retrieves a user's uploads

Parameters:
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
Returns:
Zend_Gdata_YouTube_VideoFeed The videos uploaded by the user

Definition at line 589 of file YouTube.php.

Here is the call graph for this function:

getVideoCommentFeed ( videoId = null,
location = null 
)

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

Parameters:
string$videoIdThe videoId of interest
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_CommentFeed The feed of videos found at the specified URL.

Definition at line 365 of file YouTube.php.

Here is the call graph for this function:

getVideoEntry ( videoId = null,
location = null,
fullEntry = false 
)

Retrieves a specific video entry.

Parameters:
mixed$videoIdThe 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.
Exceptions:
Zend_Gdata_App_HttpException
Returns:
Zend_Gdata_YouTube_VideoEntry The video entry found at the specified URL.

Definition at line 279 of file YouTube.php.

Here is the call graph for this function:

getVideoFeed ( location = null)

Retrieves a feed of videos.

Parameters:
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_VideoFeed The feed of videos found at the specified URL.

Definition at line 254 of file YouTube.php.

Here is the call graph for this function:

getVideoResponseFeed ( videoId = null,
location = null 
)

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

Parameters:
string$videoIdThe videoId of interest
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_VideoFeed The feed of videos found at the specified URL.

Definition at line 343 of file YouTube.php.

Here is the call graph for this function:

getWatchOnMobileVideoFeed ( location = null)

Retrieves a feed of videos recently featured for mobile devices. These videos will have RTSP links in the $entry->mediaGroup->content

Parameters:
mixed$location(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Returns:
Zend_Gdata_YouTube_VideoFeed The feed of videos found at the specified URL.

Definition at line 480 of file YouTube.php.

Here is the call graph for this function:

static parseFormUploadTokenResponse ( response) [static]

Helper function for parsing a YouTube token response

Parameters:
string$responseThe service response
Exceptions:
Zend_Gdata_App_Exception
Returns:
array An array containing the token and URL

Definition at line 650 of file YouTube.php.

Here is the caller graph for this function:

replyToCommentEntry ( commentEntry,
commentText 
)

Post a comment in reply to an existing comment

Parameters:
$commentEntryZend_Gdata_YouTube_CommentEntry The comment entry to reply to
$commentTextstring The text of the comment to post
Returns:
A Zend_Gdata_YouTube_CommentEntry representing the posted comment

Definition at line 853 of file YouTube.php.

Here is the call graph for this function:

sendVideoMessage ( body,
videoEntry = null,
videoId = null,
recipientUserName 
)

Send a video message.

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

Parameters:
string$bodyThe body of the message
Zend_Gdata_YouTube_VideoEntry(optional) The video entry to send
string$videoIdThe id of the video to send
string$recipientUserNameThe username of the recipient
Exceptions:
Zend_Gdata_App_InvalidArgumentExceptionif no valid Zend_Gdata_YouTube_VideoEntry or videoId were provided
Returns:
Zend_Gdata_YouTube_InboxEntry|null The Zend_Gdata_YouTube_Inbox_Entry representing the sent message.

Definition at line 800 of file YouTube.php.

Here is the call graph for this function:

setHttpClient ( client,
applicationId = 'MyCompany-MyApp-1.0',
clientId = null,
developerKey = null 
)

Set the Zend_Http_Client object used for communication

Parameters:
Zend_Http_Client$clientThe client to use for communication
Exceptions:
Zend_Gdata_App_HttpException
Returns:
Zend_Gdata_App Provides a fluent interface

Definition at line 222 of file YouTube.php.

Here is the caller graph for this function:


Field Documentation

$namespaces [static]
Initial value:
 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)
    )

Reimplemented from Zend_Gdata_Media.

Definition at line 185 of file YouTube.php.

Definition at line 143 of file YouTube.php.

const ACTIVITY_FEED_URI = 'http://gdata.youtube.com/feeds/api/events'

Definition at line 116 of file YouTube.php.

const AUTH_SERVICE_NAME = 'youtube'

Reimplemented from Zend_Gdata.

Definition at line 88 of file YouTube.php.

const CLIENTLOGIN_URL = 'https://www.google.com/youtube/accounts/ClientLogin'

Definition at line 89 of file YouTube.php.

const FAVORITES_URI_SUFFIX = 'favorites'

Definition at line 150 of file YouTube.php.

Initial value:
        'http://gdata.youtube.com/feeds/api/users/default/friendsactivity'

Definition at line 117 of file YouTube.php.

Initial value:
         'http://gdata.youtube.com/schemas/2007#in-reply-to'

Definition at line 126 of file YouTube.php.

Initial value:
        'http://gdata.youtube.com/feeds/api/users/default/inbox'

Definition at line 134 of file YouTube.php.

const INBOX_URI_SUFFIX = 'inbox'

Definition at line 178 of file YouTube.php.

const PLAYLIST_REL = 'http://gdata.youtube.com/schemas/2007#playlist'

Definition at line 107 of file YouTube.php.

const RELATED_URI_SUFFIX = 'related'

Definition at line 171 of file YouTube.php.

Definition at line 164 of file YouTube.php.

const STANDARD_MOST_VIEWED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed'

Definition at line 92 of file YouTube.php.

Initial value:
        'http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed'

Definition at line 98 of file YouTube.php.

const STANDARD_RECENTLY_FEATURED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'

Definition at line 93 of file YouTube.php.

Initial value:
        'http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured'

Definition at line 100 of file YouTube.php.

const STANDARD_TOP_RATED_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'

Definition at line 91 of file YouTube.php.

Initial value:
        'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'

Definition at line 96 of file YouTube.php.

const STANDARD_WATCH_ON_MOBILE_URI = 'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'

Definition at line 94 of file YouTube.php.

Initial value:
        'http://gdata.youtube.com/feeds/api/standardfeeds/watch_on_mobile'

Definition at line 102 of file YouTube.php.

const UPLOADS_URI_SUFFIX = 'uploads'

Definition at line 157 of file YouTube.php.

const USER_CONTACTS_REL = 'http://gdata.youtube.com/schemas/2007#user.contacts'

Definition at line 111 of file YouTube.php.

const USER_FAVORITES_REL = 'http://gdata.youtube.com/schemas/2007#user.favorites'

Definition at line 112 of file YouTube.php.

const USER_PLAYLISTS_REL = 'http://gdata.youtube.com/schemas/2007#user.playlists'

Definition at line 109 of file YouTube.php.

const USER_SUBSCRIPTIONS_REL = 'http://gdata.youtube.com/schemas/2007#user.subscriptions'

Definition at line 110 of file YouTube.php.

const USER_UPLOADS_REL = 'http://gdata.youtube.com/schemas/2007#user.uploads'

Definition at line 108 of file YouTube.php.

const USER_URI = 'http://gdata.youtube.com/feeds/api/users'

Definition at line 105 of file YouTube.php.

const VIDEO_COMPLAINTS_REL = 'http://gdata.youtube.com/schemas/2007#video.complaints'

Definition at line 115 of file YouTube.php.

const VIDEO_RATINGS_REL = 'http://gdata.youtube.com/schemas/2007#video.ratings'

Definition at line 114 of file YouTube.php.

const VIDEO_RESPONSES_REL = 'http://gdata.youtube.com/schemas/2007#video.responses'

Definition at line 113 of file YouTube.php.

const VIDEO_URI = 'http://gdata.youtube.com/feeds/api/videos'

Definition at line 106 of file YouTube.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations