Description

Php5tube Class.

Php5tube is a class written by Debugged Interactive Designs in PHP5 to act as a wrapper for Youtube's API.

Methods process the response XML and return a friendly array of data to make development simple and intuitive.

Located in /Php5tube.php (line 62)


	
			
Variable Summary
Method Summary
Php5tube Php5tube (string $video, string $user, string $comment)
array getMostViewed ([int $start_index = 1], [int $max = 25])
array getUserInfo (string $user)
array getUserVideos (string $user, [string $category = null], [integer $start_index = 1], [integer $max = 25])
array getVideoComments (string $id, [int $start_index = 1], [int $max = 25])
array getVideoInfo (string $id)
Variables
string $comment_object = null (line 103)

The comment object name in the returned array

int $next_index = -1 (line 111)

Set to the next index in the query or -1, if there are no more videos left

string $user_object = null (line 96)

The user object name in the returned array

string $video_object = null (line 89)

The video object name in the returned array

Methods
Constructor Php5tube (line 131)

Class constructor.

  1.    <?php
  2.    include 'Php5tube.php';
  3.    $php5tube new Php5tube('Video','User','Comment');
  4.    ?>
Php5tube Php5tube (string $video, string $user, string $comment)
  • string $video: The video object name in the returned array.
  • string $user: The user object name in the returned array
  • string $comment: The comment object name in the returned array
getMostViewed (line 358)

Returns a list of the most frequently viewed videos on youtube.

  1.    <?php
  2.    include 'Php5tube.php';
  3.    $php5tube new Php5tube('Video','User','Comment');
  4.    $most_viewed $php5tube->getMostViewed(1,10);
  5.    ?>
  • return: array[<numbered_index>][$this->video_object][<field_name>] where <field_name> =
    {'youtube_id', 'author', 'title', 'description', 'keywords', 'url', 'thumbnail1', 'thumbnail2', 'thumbnail3', 'thumbnail4', 'length', 'view_count', 'favorite_count', 'comments_count'}
array getMostViewed ([int $start_index = 1], [int $max = 25])
  • int $start_index: Start at the nth most viewed video. The default is to start the number 1 most viewed video.
  • int $max: The maximum number of videos returned in list. The default is 25 videos.
getUserInfo (line 304)

Returns the account information of a youtube user.

  1.    <?php
  2.    include 'Php5tube.php';
  3.    $php5tube new Php5tube('Video','User','Comment');
  4.    $user_info $php5tube->getUserInfo('rickrolled');
  5.    ?>
  • return: array[$this->user_object][<field_name>] where <field_name> =
    {'username', 'first_name', 'last_name', 'age', 'hobbies', 'relationship', 'occupation', 'music','movies', 'location', 'hometown', 'gender', 'description'}
array getUserInfo (string $user)
  • string $user: - The account name of the youtube user.
getUserVideos (line 160)

Returns all youtube videos that belong to the corresponding user.

  1.    <?php
  2.    include 'Php5tube.php';
  3.    $php5tube new Php5tube('Video','User','Comment');
  4.    $user_vids $php5tube->getUserVideos('rickrolled','',1,10);
  5.    ?>
  • return: array[<numbered_index>][$this->video_object][<field_name>] where <field_name> =
    {'youtube_id', 'author', 'title', 'description', 'keywords', 'url', 'thumbnail1', 'thumbnail2', 'thumbnail3', 'thumbnail4', 'length', 'view_count', 'favorite_count', 'comments_count'}
array getUserVideos (string $user, [string $category = null], [integer $start_index = 1], [integer $max = 25])
  • string $user: The account name of the youtube user.
  • string $category: The category to search.
  • integer $start_index: The first video id you want to grab. The default is 1.
  • integer $max: The maximum number of videos returned.
getVideoComments (line 491)

Returns the video comments of a youtube video.
Note: this function does not set the next starting index instance variable in the class.

  1.    <?php
  2.    include 'Php5tube.php';
  3.    $php5tube new Php5tube('Video','User','Comment');
  4.    $vid_comments $php5tube->getVideoComments('oHg5SJYRHA0',1,10);
  5.    ?>
  • return: array[<numbered_index>][$this->video_object][<field_name>] where <field_name> =
    {'youtube_id', 'author','title','content','updated','published'}
array getVideoComments (string $id, [int $start_index = 1], [int $max = 25])
  • string $id: The video's youtube id.
  • int $start_index: start_index The first entry returned.
  • int $max: max The number of results returned.
getVideoInfo (line 549)

Returns the information of a youtube video.

  1.    <?php
  2.    include 'Php5tube.php';
  3.    $php5tube new Php5tube('Video','User','Comment');
  4.    $vid_info $php5tube->getVideoInfo('oHg5SJYRHA0');
  5.    ?>
  • return: array[$this->video_object][<field_name>] where <field_name> =
    {'youtube_id', 'author', 'title', 'description', 'keywords', 'url', 'thumbnail1', 'thumbnail2', 'thumbnail3', 'thumbnail4', 'length', 'view_count', 'favorite_count', 'comments_count'}
array getVideoInfo (string $id)
  • string $id: - The video's youtube id.

Documentation generated by phpDocumentor 1.4.1