
August 6th, 2006, 04:33 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Posts: 1
Time spent in forums: 2 m 54 sec
Reputation Power: 0
|
|
|
MagpieRSS problem youtube feed
Hi, I found this script, to parse youtube videostills of a specified tag on my home page, but it shows every item on the rss page, i want them to show only 6 items, I cant get it to work with the script, ill post the script, can somebody help me out with this one? thanks
Code:
require_once('rss_fetch.inc');
$tag = "http://www.youtube.com/rss/tag/".$video.".rss";
if ( $video ) {
echo "<table border='0'>";
$rss = fetch_rss( $tag );
$numvideos = 0;
foreach ($rss->items as $item) {
if ($numvideos == 2 || $numvideos == 4 || $numvideos == 6 || $numvideos == 0){ echo "</tr><tr>";}
$numvideos++;
preg_match('/img src="(.*)\.jpg"/',$item["description"],$imgUrlMatches);
$imgurl = $imgUrlMatches[0];
$title = $item["title"];
$url = $item["link"];
echo "<td align='center'><a href=\"$url\">"
."<$imgurl alt=\"$title\"/>"
."</a>\n</td>";
}
echo "</table>";
}
This is the code, it works perfectly, and the way it is now, its showing, 2 images next to eachother, than the next images, untill six, and then, all the other items of the feed are shown, I dont want them to be there.
This is how it shows now: darkcentral.net/test/searchvideosF.php
Greetz
|