Thread: an rss problem
View Single Post
Old 07-11-2008, 03:54 PM   #1 (permalink)
codefreek
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Smile an rss problem

CODE FIXED! - thank you Noia!


PHP Code:
    <?php

    
//only use when needed!
    //ini_set("user_agent","Internet Explorer");

    //Edit here for your rss link
    
$location "http://youtube.com/rss/global/top_rated.rss";
    
$contents file_get_contents($location);
    
$xml      = new SimpleXMLElement($contents);
    
$limiter 0;

    print 
"<ol>";

    foreach(
$xml->channel->item as $item) {
       print 
"<li>";
    
$linkarray explode("=",$item->link);
    print 
"<a href='".$item->link."' title='".$item->title."'>";
    print 
"<img src=\"http://s2.ytimg.com/vi/".$linkarray[1]."/default.jpg\" title=\"My Thumbnail!\" />";
    print 
$item->title;
    print 
"</a>";
    print 
"</li>";
    
$limiter++;
    if (
$limiter == 5) break;
    
$deslimit++;
   
    }

    print 
"</ol>";


    
?>

CODE FIXED! - thank you Noia!

Last edited by codefreek : 07-11-2008 at 04:13 PM. Reason: CODE FIXED! - THANK YOU NOIA!
codefreek is offline  
Reply With Quote