PHP Classes
elePHPant
Icontem

File: examples.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vitaliy  >  YouTube Tools  >  examples.php  >  Download  
File: examples.php
Role: Example script
Content type: text/plain
Description: Exaples using class
Class: YouTube Tools
Download and get information about YouTube videos
Author: By
Last change:
Date: 3 years ago
Size: 655 bytes
 

Contents

Class file image Download
<?php
require 'yt.php';
$manager = new Youtube_Tools();

# Get information about video
$manager->id = 'SqhWFk5wts4';
$manager->get_video_info();
echo
'<pre>';
print_r($manager->info);
echo
'</pre>';

# Get video data
$manager->id = 'SqhWFk5wts4';
echo
'<pre>';
print_r($manager->get_data());
echo
'</pre>';

# Get video links
$manager->id = 'SqhWFk5wts4';
echo
'<pre>';
print_r($manager->get_links());
echo
'</pre>';

# Save video
$manager->id = 'SqhWFk5wts4';
$path = realpath(dirname(__FILE__));
$manager->save('flv-640x360', $path);

# Video search
echo '<pre>';
print_r($manager->search('Ukraine'));
echo
'</pre>';

?>