Services_YouTube
[ class tree: Services_YouTube ] [ index: Services_YouTube ] [ all elements ]

Class: Services_YouTube

Source Location: /Services_YouTube-0.2.2/YouTube.php

Class Overview


Services_YouTube


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 39]
Services_YouTube


[ Top ]


Class Variables

$cacheOptions = array()

[line 96]

cache_lite options
  • Access: protected

Type:   array


[ Top ]

$developerId =  null

[line 74]

Developer ID
  • Access: protected

Type:   string


[ Top ]

$driver =  'rest'

[line 82]

driver
  • Access: protected

Type:   string


[ Top ]

$responseFormat =  'object'

[line 103]

format of the xml response
  • Access: protected

Type:   string


[ Top ]

$useCache =  false

[line 89]

Use cache
  • Access: protected

Type:   boolean


[ Top ]



Method Detail

__construct (Constructor)   [line 116]

void __construct( string $developerId, [mixed[] $options = array()])

Constructor
  • Access: public

Parameters:

string   $developerId     Developer ID
mixed[]   $options     useCache, cacheOptions, responseFormat, driver

[ Top ]

forArray   [line 621]

array forArray( mixed $object)

Parse all SimpleXMLElement to array
  • Access: protected

Parameters:

mixed   $object     SimpleXMLElement or array

[ Top ]

getAvailableCategories   [line 150]

void getAvailableCategories( )

Return array of available category array which key is category id and value is category name.
  • Access: public

[ Top ]

getAvailableTimeRanges   [line 138]

void getAvailableTimeRanges( )

Return array of available time range
  • Access: public

[ Top ]

getDetails   [line 289]

array getDetails( string $videoId)

Displays the details for a video.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $videoId     The ID of the video to get details for. This is the ID that's returned by the list

[ Top ]

getProfile   [line 235]

array getProfile( string $user)

Retrieves the public parts of a user profile.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user     The user to retrieve the profile for. This is the same as the name that shows up on the YouTube website.

[ Top ]

listByCategoryAndTag   [line 412]

array listByCategoryAndTag( string $categoryId, string $tag, [int $page = 1], [int $perPage = 20])

Lists all videos that have the specified category id and tag.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $categoryId     the category id to search in
string   $tag     the tag to search for
int   $page     the "page" of results you want to retrieve
int   $perPage     the number of results you want to retrieve per page (default 20, maximum 100)

[ Top ]

listByPlaylist   [line 361]

array listByPlaylist( string $id, [int $page = 1], [int $perPage = 20])

Lists all videos in the specified playlist.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $id     the id of the playlist
int   $page     the "page" of results you want to retrieve (e.g. 1, 2, 3) (default 1)
int   $perPage     the number of results you want to retrieve per page (default 20, maximum 100)

[ Top ]

listByPopular   [line 385]

array listByPopular( [string $timeRange = 'all'])

Lists all videos in the specified time_range.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $timeRange     the time_range to list by (e.g. 'day', 'week', 'month', 'all')

[ Top ]

listByRelated   [line 335]

array listByRelated( string $tag, [int $page = 1], [int $perPage = 20])

Lists all videos that match any of the specified tags.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $tag     the tag to search for
int   $page     the "page" of results you want to retrieve (e.g. 1, 2, 3) (default 1)
int   $perPage     the number of results you want to retrieve per page (default 20, maximum 100)

[ Top ]

listByTag   [line 309]

array listByTag( string $tag, [int $page = 1], [int $perPage = 20])

Lists all videos that have the specified tag.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $tag     the tag to search for
int   $page     the "page" of results you want to retrieve (e.g. 1, 2, 3) (default 1)
int   $perPage     the number of results you want to retrieve per page (default 20, maximum 100)

[ Top ]

listByUser   [line 444]

array listByUser( string $user)

Lists all videos that were uploaded by the specified user
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user     user whose videos you want to list

[ Top ]

listFavoriteVideos   [line 253]

array listFavoriteVideos( string $user)

Lists a user's favorite videos.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user     The user to retrieve the favorite videos for. This is the same as the name that shows up on the YouTube website

[ Top ]

listFeatured   [line 459]

array listFeatured( )

Lists the most recent 25 videos that have been featured on the front page of the YouTube site.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

[ Top ]

listFriends   [line 271]

array listFriends( string $user)

Lists a user's friends.
  • Return: on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $user     The user to retrieve the favorite videos for. This is the same as the name that shows up on the YouTube website

[ Top ]

parseResponse   [line 592]

SimpleXMLElement parseResponse( string $response)

parseResponse
  • Return: or array of the response data.
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $response     Response xml

[ Top ]

sendRequest   [line 481]

SimpleXMLObject sendRequest( string $prefix, string $method, array $parameters)

Send Request either rest or xmlrpc approach, and return simplexml_element of the response.

When $this->usesCaches is true, use Cache_Lite the response xml. If $this->responseFormat is "array", return array, instead simplexml_element.

  • Return: or Array on success, error object on failure
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $prefix     Unknown
string   $method     Method
array   $parameters     Arguments

[ Top ]

setDriver   [line 177]

void setDriver( string $driver)

Choose which driver to use(XML-RPC or REST)
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $driver     Driver name (xmlrpc, rest)

[ Top ]

setResponseFormat   [line 195]

void setResponseFormat( string $responseFormat)

Choose which Response Fomat to use
  • Throws: Services_YouTube_Exception
  • Access: public

Parameters:

string   $responseFormat     One of 'object', 'array'

[ Top ]

setUseCache   [line 215]

void setUseCache( [mixed $useCache = false], [array $cacheOptions = array()])

Choose if this uses Cache_Lite.

If this uses Cache_Lite, then set the cacheOptions for Cache_Lite

  • Access: public

Parameters:

mixed   $useCache     Use cache?
array   $cacheOptions     Cache options

[ Top ]

useRest   [line 524]

string useRest( string $method, array $parameters)

Use REST approach.
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $method     Method
array   $parameters     Arguments

[ Top ]

useXMLRPC   [line 564]

string useXMLRPC( string $prefix, string $method, array $parameters)

Use XML-RPC approach.
  • Throws: Services_YouTube_Exception
  • Access: protected

Parameters:

string   $prefix     Unknown
string   $method     Method to call
array   $parameters     Method args

[ Top ]


Documentation generated on Mon, 05 Jan 2009 02:00:31 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.