TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   an rss problem (http://www.talkphp.com/absolute-beginners/3104-rss-problem.html)

codefreek 07-11-2008 03:54 PM

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!


All times are GMT. The time now is 10:38 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0