API Documentation

Gdata/YouTube.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Gdata
subpackage
YouTube
version
$Id: YouTube.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Gdata_YouTube

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Gdata_YouTube

Extends from
Zend_Gdata_Media
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
link
http://code.google.com/apis/youtube/
package
Zend_Gdata
subpackage
YouTube
Constants
AUTH_SERVICE_NAME
CLIENTLOGIN_URL
STANDARD_TOP_RATED_URI
STANDARD_MOST_VIEWED_URI
STANDARD_RECENTLY_FEATURED_URI
STANDARD_WATCH_ON_MOBILE_URI
STANDARD_TOP_RATED_URI_V2
STANDARD_MOST_VIEWED_URI_V2
STANDARD_RECENTLY_FEATURED_URI_V2
STANDARD_WATCH_ON_MOBILE_URI_V2
USER_URI
VIDEO_URI
PLAYLIST_REL
USER_UPLOADS_REL
USER_PLAYLISTS_REL
USER_SUBSCRIPTIONS_REL
USER_CONTACTS_REL
USER_FAVORITES_REL
VIDEO_RESPONSES_REL
VIDEO_RATINGS_REL
VIDEO_COMPLAINTS_REL
ACTIVITY_FEED_URI
FRIEND_ACTIVITY_FEED_URI
IN_REPLY_TO_SCHEME
INBOX_FEED_URI
ACTIVITY_FEED_MAX_USERS
FAVORITES_URI_SUFFIX
UPLOADS_URI_SUFFIX
RESPONSES_URI_SUFFIX
RELATED_URI_SUFFIX
INBOX_URI_SUFFIX
Properties
$namespaces
Methods
__construct
setHttpClient
getVideoFeed
getVideoEntry
getFullVideoEntry
getRelatedVideoFeed
getVideoResponseFeed
getVideoCommentFeed
getTopRatedVideoFeed
getMostViewedVideoFeed
getRecentlyFeaturedVideoFeed
getWatchOnMobileVideoFeed
getPlaylistListFeed
getPlaylistVideoFeed
getSubscriptionFeed
getContactFeed
getUserUploads
getUserFavorites
getUserProfile
parseFormUploadTokenResponse
getFormUploadToken
getActivityForUser
getFriendActivityForCurrentUser
getInboxFeedForCurrentUser
sendVideoMessage
replyToCommentEntry

Description

Service class for interacting with the YouTube Data API.

Constants

AUTH_SERVICE_NAME

 AUTH_SERVICE_NAME = 'youtube'

Details

value
youtube

CLIENTLOGIN_URL

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

Details

value
https://www.google.com/youtube/accounts/ClientLogin

STANDARD_TOP_RATED_URI

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

Details

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

STANDARD_MOST_VIEWED_URI

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

Details

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

STANDARD_RECENTLY_FEATURED_URI

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

Details

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

STANDARD_WATCH_ON_MOBILE_URI

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

Details

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

STANDARD_TOP_RATED_URI_V2

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

Details

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

STANDARD_MOST_VIEWED_URI_V2

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

Details

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

STANDARD_RECENTLY_FEATURED_URI_V2

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

Details

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

STANDARD_WATCH_ON_MOBILE_URI_V2

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

Details

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

USER_URI

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

Details

value
http://gdata.youtube.com/feeds/api/users

VIDEO_URI

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

Details

value
http://gdata.youtube.com/feeds/api/videos

PLAYLIST_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#playlist

USER_UPLOADS_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#user.uploads

USER_PLAYLISTS_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#user.playlists

USER_SUBSCRIPTIONS_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#user.subscriptions

USER_CONTACTS_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#user.contacts

USER_FAVORITES_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#user.favorites

VIDEO_RESPONSES_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#video.responses

VIDEO_RATINGS_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#video.ratings

VIDEO_COMPLAINTS_REL

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

Details

value
http://gdata.youtube.com/schemas/2007#video.complaints

ACTIVITY_FEED_URI

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

Details

value
http://gdata.youtube.com/feeds/api/events

FRIEND_ACTIVITY_FEED_URI

 FRIEND_ACTIVITY_FEED_URI = 'http://gdata.youtube.com/feeds/api/users/default/friendsactivity'

Details

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

IN_REPLY_TO_SCHEME

string IN_REPLY_TO_SCHEME = 'http://gdata.youtube.com/schemas/2007#in-reply-to'

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

Details

value
http://gdata.youtube.com/schemas/2007#in-reply-to
IN_REPLY_TO_SCHEME
string

INBOX_FEED_URI

string INBOX_FEED_URI = 'http://gdata.youtube.com/feeds/api/users/default/inbox'

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

Details

value
http://gdata.youtube.com/feeds/api/users/default/inbox
INBOX_FEED_URI
string

ACTIVITY_FEED_MAX_USERS

integer ACTIVITY_FEED_MAX_USERS = '20'

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

Details

value
20
ACTIVITY_FEED_MAX_USERS
integer

FAVORITES_URI_SUFFIX

string FAVORITES_URI_SUFFIX = 'favorites'

The suffix for a feed of favorites.

Details

value
favorites
FAVORITES_URI_SUFFIX
string

UPLOADS_URI_SUFFIX

string UPLOADS_URI_SUFFIX = 'uploads'

The suffix for the user's upload feed.

Details

value
uploads
UPLOADS_URI_SUFFIX
string

RESPONSES_URI_SUFFIX

string RESPONSES_URI_SUFFIX = 'responses'

The suffix for a feed of video responses.

Details

value
responses
RESPONSES_URI_SUFFIX
string

RELATED_URI_SUFFIX

string RELATED_URI_SUFFIX = 'related'

The suffix for a feed of related videos.

Details

value
related
RELATED_URI_SUFFIX
string

INBOX_URI_SUFFIX

string INBOX_URI_SUFFIX = 'inbox'

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

Details

value
inbox
INBOX_URI_SUFFIX
string

Properties

$namespaces

array $namespaces = 'array'

Namespaces used for Zend_Gdata_YouTube

Details

$namespaces
array
visibility
public
default
array
final
false
static
true

Methods

__construct

__construct( Zend_Http_Client $client = null, string $applicationId = MyCompany-MyApp-1.0, string $clientId = null, string $developerKey = null ) :

Create Zend_Gdata_YouTube object

Arguments
$client
Zend_Http_Client
(optional) The HTTP client to use when when communicating with the Google servers.
$applicationId
string
The identity of the app in the form of Company-AppName-Version
$clientId
string
The clientId issued by the YouTube dashboard
$developerKey
string
The developerKey issued by the YouTube dashboard
Details
visibility
public
final
false
static
false

getActivityForUser

getActivityForUser(  $username ) : Zend_Gdata_YouTube_ActivityFeed

Retrieves the activity feed for users

Arguments
$username
Details
visibility
public
final
false
static
false
throws
if using version less than 2.

getContactFeed

getContactFeed( string $user = null, mixed $location = null ) : Zend_Gdata_YouTube_ContactFeed

Retrieves a feed of a user's contacts

Arguments
$user
string
(optional) The username of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_ContactFeed
The feed of contacts
Details
visibility
public
final
false
static
false

getFormUploadToken

getFormUploadToken( Zend_Gdata_YouTube_VideoEntry $videoEntry, string $url = http://gdata.youtube.com/action/GetUploadToken ) : array

Retrieves a YouTube token

Arguments
$videoEntry
Zend_Gdata_YouTube_VideoEntry
The video entry
$url
string
The location as a string URL
Output
array
An array containing a token and URL
Details
visibility
public
final
false
static
false
throws

getFriendActivityForCurrentUser

getFriendActivityForCurrentUser( ) : Zend_Gdata_YouTube_ActivityFeed

Retrieve the activity of the currently authenticated users friend.

Details
visibility
public
final
false
static
false
throws
if not logged in.

getFullVideoEntry

getFullVideoEntry(  $videoId ) : Zend_Gdata_YouTube_VideoEntry|null

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

Arguments
$videoId
Output
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.
Details
visibility
public
final
false
static
false
throws

getInboxFeedForCurrentUser

getInboxFeedForCurrentUser( ) : Zend_Gdata_YouTube_InboxFeed|null

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

Details
visibility
public
final
false
static
false
throws
if not logged in.

getMostViewedVideoFeed

getMostViewedVideoFeed( mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

Retrieves a feed of the most viewed videos.

Arguments
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getPlaylistListFeed

getPlaylistListFeed( string $user = null, mixed $location = null ) : Zend_Gdata_YouTube_PlaylistListFeed

Retrieves a feed which lists a user's playlist

Arguments
$user
string
(optional) The username of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_PlaylistListFeed
The feed of playlists
Details
visibility
public
final
false
static
false

getPlaylistVideoFeed

getPlaylistVideoFeed( mixed $location ) : Zend_Gdata_YouTube_PlaylistVideoFeed

Retrieves a feed of videos in a particular playlist

Arguments
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_PlaylistVideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getRecentlyFeaturedVideoFeed

getRecentlyFeaturedVideoFeed( mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

Retrieves a feed of recently featured videos.

Arguments
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getRelatedVideoFeed

getRelatedVideoFeed( string $videoId = null, mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

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

Arguments
$videoId
string
The videoId of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getSubscriptionFeed

getSubscriptionFeed( string $user = null, mixed $location = null ) : Zend_Gdata_YouTube_SubscriptionListFeed

Retrieves a feed of a user's subscriptions

Arguments
$user
string
(optional) The username of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_SubscriptionListFeed
The feed of subscriptions
Details
visibility
public
final
false
static
false

getTopRatedVideoFeed

getTopRatedVideoFeed( mixed $location = null ) : Zend_Gdata_YouTube_CommentFeed

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

Arguments
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_CommentFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getUserFavorites

getUserFavorites( string $user = null, mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

Retrieves a user's favorites

Arguments
$user
string
(optional) The username of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The videos favorited by the user
Details
visibility
public
final
false
static
false

getUserProfile

getUserProfile( string $user = null, mixed $location = null ) : Zend_Gdata_YouTube_UserProfileEntry

Retrieves a user's profile as an entry

Arguments
$user
string
(optional) The username of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_UserProfileEntry
The user profile entry
Details
visibility
public
final
false
static
false

getUserUploads

getUserUploads( string $user = null, mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

Retrieves a user's uploads

Arguments
$user
string
(optional) The username of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The videos uploaded by the user
Details
visibility
public
final
false
static
false

getVideoCommentFeed

getVideoCommentFeed( string $videoId = null, mixed $location = null ) : Zend_Gdata_YouTube_CommentFeed

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

Arguments
$videoId
string
The videoId of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_CommentFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getVideoEntry

getVideoEntry( mixed $videoId = null, mixed $location = null, boolean $fullEntry = false ) : Zend_Gdata_YouTube_VideoEntry

Retrieves a specific video entry.

Arguments
$videoId
mixed
The ID of the video to retrieve.
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined.
$fullEntry
boolean
(optional) Retrieve the full metadata for the entry. Only possible if entry belongs to currently authenticated user. An exception will be thrown otherwise.
Output
Zend_Gdata_YouTube_VideoEntry
The video entry found at the specified URL.
Details
visibility
public
final
false
static
false
throws

getVideoFeed

getVideoFeed( mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

Retrieves a feed of videos.

Arguments
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getVideoResponseFeed

getVideoResponseFeed( string $videoId = null, mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

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

Arguments
$videoId
string
The videoId of interest
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

getWatchOnMobileVideoFeed

getWatchOnMobileVideoFeed( mixed $location = null ) : Zend_Gdata_YouTube_VideoFeed

Retrieves a feed of videos recently featured for mobile devices.

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

Arguments
$location
mixed
(optional) The URL to query or a Zend_Gdata_Query object from which a URL can be determined
Output
Zend_Gdata_YouTube_VideoFeed
The feed of videos found at the specified URL.
Details
visibility
public
final
false
static
false

parseFormUploadTokenResponse

parseFormUploadTokenResponse( string $response ) : array

Helper function for parsing a YouTube token response

Arguments
$response
string
The service response
Output
array
An array containing the token and URL
Details
visibility
public
final
false
static
true
throws

replyToCommentEntry

replyToCommentEntry( $commentEntry $commentEntry, $commentText $commentText ) : A

Post a comment in reply to an existing comment

Arguments
$commentEntry
$commentEntry
Zend_Gdata_YouTube_CommentEntry The comment entry to reply to
$commentText
$commentText
string The text of the comment to post
Output
A
Zend_Gdata_YouTube_CommentEntry representing the posted comment
Details
visibility
public
final
false
static
false

sendVideoMessage

sendVideoMessage( string $body, Zend_Gdata_YouTube_VideoEntry $videoEntry = null, string $videoId = null, string $recipientUserName ) : Zend_Gdata_YouTube_InboxEntry|null

Send a video message.

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

Arguments
$body
string
The body of the message
$videoEntry
Zend_Gdata_YouTube_VideoEntry
(optional) The video entry to send
$videoId
string
The id of the video to send
$recipientUserName
string
The username of the recipient
Output
Zend_Gdata_YouTube_InboxEntry|null
The Zend_Gdata_YouTube_Inbox_Entry representing the sent message.
Details
visibility
public
final
false
static
false
throws
if no valid Zend_Gdata_YouTube_VideoEntry or videoId were provided

setHttpClient

setHttpClient( Zend_Http_Client $client,  $applicationId = MyCompany-MyApp-1.0,  $clientId = null,  $developerKey = null ) : Zend_Gdata_App

Set the Zend_Http_Client object used for communication

Arguments
$client
Zend_Http_Client
The client to use for communication
$applicationId
$clientId
$developerKey
Output
Zend_Gdata_App
Provides a fluent interface
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.