Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Feed using GET request (http://www.go4expert.com/forums/feed-using-request-t21383/)

suhas93 17Mar2010 10:56

Feed using GET request
 
Hi,

I am using simplepie library (simplepie.org) to write a simple script. I want to use a XML feed with GET request.

How can I do it?

PS: I'm a PHP newbie..

Code:

<?php
require_once('simplepie.inc');
 
$feed = new SimplePie(); 
$feed->set_feed_url(ttp://blah.com/atom.xml?max-results=100); 
$feed->set_item_class(); 
$feed->enable_cache(true); 
$feed->set_cache_duration(3600); 
$feed->set_cache_location('cache'); 
$feed->init(); 
$feed->handle_content_type(); 
 
 
foreach ($feed->get_items() as $item)
{
                echo $item->get_title();                   
}
 
?>



All times are GMT +5.5. The time now is 12:40.