Login   Register  
PHP Classes
elePHPant
Icontem

File: Services/youtube.example

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Leonardo Branco Shinagawa  >  Feedee  >  Services/youtube.example  >  Download  
File: Services/youtube.example
Role: Example script
Content type: text/plain
Description: Youtube Example
Class: Feedee
Retrieve and parse RSS feed from remote sites
Author: By
Last change:
Date: 2010-12-07 12:29
Size: 1,440 bytes
 

Contents

Class file image Download
<?php

/* EXAMPLE 1 */

$youtube = new Feedee('youtube');
$youtube->setUser('djshina'); // The user name on Youtube
$youtube->setType('uploads'); // We want to get the uploads

foreach ($youtube as $video)
{
        echo 
'<h1><a href="'.$video->link.'">'.$video->title.'</a></h1>';
        echo 
$video->embed;
}

/* OPTIONS */

// USER MODE
$youtube->setUser($username); // Is used to get the user videos.
$youtube->setType($type); // Type can be 'uploads' or 'favorites'.

// ATTRIBUTES
$video->title;
$video->link;
$video->embed//display the player
$video->width//used to set the width of the player. Default is 640
$video->height//user to set the height of the player. Default is 385





// PLAYLIST MODE
$youtube->setPlaylist($playlist); // Get all videos of a playlist code.

// ATTRIBUTES
$video->title;
$video->link;
$video->author;
$video->authorLink;
$video->embed//display the player
$video->width//used to set the width of the player. Default is 640
$video->height//user to set the height of the player. Default is 385






// VIDEO MODE
$youtube->setVideo($videoUrl); // the full url of the video

//ATTRIBUTES
$video->title;
$video->html;
$video->author;
$video->embed//display the player
$video->width//used to set the width of the player. Default is 640
$video->height//user to set the height of the player. Default is 385
$video->thumbWidth;
$video->thumbHeight;
$video->thumb// Url of the image thumb.