<?php
<?php
$ts = microtime(true);
$videos = array('SUVsAgaV6lM', '_HKzFR4PJIw', 'YS2j-25xBc4', '_qzJrghqDg4', 'OTR9vHunfao', 'CcU-gxR_DDA', '5VK1KYtMjIQ', 'uCURnJA4hxg', 'KCw0zQRLILQ', 'r4MAk9EaYMY');
foreach($videos as $id)
{
$json_output = file_get_contents("http://gdata.youtube.com/feeds/api/videos/".$id."?v=2&alt=json");
$json = json_decode($json_output, true);
$view_count = $json['entry']['yt$statistics']['viewCount'];
$video_likes = $json['entry']['yt$rating']['numLikes'];
$video_dislikes = $json['entry']['yt$rating']['numDislikes'];
$video_title = $json['entry']['title']['$t'];
$video_uploader = $json['entry']['author']['0']['name']['$t'];
echo"<div id='eachVideoHolder'>";
echo "<a class='fancybox fancybox.iframe' rel='one' title= '$video_title by $video_uploader' id='1' href='http://www.youtube.com/embed/".$id."'><img src='http://img.youtube.com/vi/".$id."/hqdefault.jpg' width='220' height='150'/></a>";
echo '<br>';
echo $video_title; //print the title
echo '<br>';
echo "Views: $view_count"; //print number of views
echo '<br>';
echo "<a href='http://www.youtube.com/watch?v=".$id."'> $video_uploader</a>"; //print the uploader name and linking it to the video
echo '<br>';
echo "Dislikes: $video_dislikes"; //print number of dislikes
echo '<br>';
echo "Likes: $video_likes"; //print number of likes
echo '<br>';
echo"</div>";
}
$te = microtime(true);
$xt = ($te - $ts);
echo '<p><strong>Total Execution Time: ', $xt ,'</strong></p>';
- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.29
- Parse error: syntax error, unexpected '<' in /in/q3Udk on line 3
Process exited with code 255.
preferences:
184.26 ms | 1395 KiB | 66 Q