1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Feed using GET request

Discussion in 'PHP' started by suhas93, Mar 17, 2010.

  1. suhas93

    suhas93 New Member

    Joined:
    Mar 7, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    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([B]ttp://blah.com/atom.xml?max-results=100[/B]);  
    $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();                    
    }
     
    ?>
     

Share This Page