Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Debugged Interactive Designs  >  Php5tube  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Drop this test script in the same directory as the class source
Class: Php5tube
Get information about videos using YouTube API
Author: By
Last change:
Date: 6 years ago
Size: 1,563 bytes
 

Contents

Class file image Download
<?php

//get or create youtube username
if( isset($_GET['user']) ){$youtube_user $_GET['user'];}
else {
$youtube_user 'rickrolled';}

//create php5tube object and get videos
include_once("Php5tube.php");
$php5tube = new Php5tube('Video','User','Comment');
$videos $php5tube->getUserVideos($youtube_user);

//dump array of views
//var_dump($videos);

?>

<html>
<head><title></title></head>
<body>

<table cellpadding="0" cellspacing="0">

<?php foreach($videos as $video) { ?>
<tr><td>
    <div style="padding:2px;"><img src="<?php echo $video['Video']['thumbnail_url1']; ?>"></div>
    <div style="padding:2px;"><img src="<?php echo $video['Video']['thumbnail_url2']; ?>"></div>
    <div style="padding:2px;"><img src="<?php echo $video['Video']['thumbnail_url3']; ?>"></div>
</td><td>
    <div style="padding:10px;">
        <a href="http://www.youtube.com/v/<?php echo $video['Video']['youtube_id']; ?>">
            <img src="<?php echo $video['Video']['thumbnail_url4']; ?>">
        </a>
    </div>
</td>
<td>
    <div style="font-size:16pt;"><?php echo $video['Video']['title']; ?></div>
    <div><b>Category</b> = <?php echo $video['Video']['category']; ?> times</div>
    <div><b>Tags</b> = <?php echo $video['Video']['keywords']; ?> times</div>
    <div><b>Description</b> = <?php echo $video['Video']['description']; ?></div>
    <div><b>Views</b> = <?php echo $video['Video']['view_count']; ?> times</div>
    <div><b>Marked as favorite</b> = <?php echo $video['Video']['favorite_count']; ?> times</div>
</td></tr>
<?php ?>

</table>

</body>
</html>