Skip to main content

Close
Get the best research tool on the web today,and free!
Connect with people with common interests!

saved by1 people, first byJames E Robinson, III on 2007-08-22, last byalfred westerveld on 2008-07-15

  • 16.1.8. Fetching a feed



    Use the getFeed() function to retrieve
    a feed from a specified URI.
    This function returns an instance of class specified
    as the second argument to getFeed, which defaults to
    Zend_Gdata_Feed.



    <?php
    $gdata 
    = new Zend_Gdata();
    $query = new Zend_Gdata_Query(
            
    'http://www.blogger.com/feeds/blogID/posts/default');
    $query->setMaxResults(10);
    $feed $gdata->getFeed($query);



    See later sections for special functions in each
    helper class for Google Data services. These
    functions help you to get feeds from the URI that is
    appropriate for the respective service.


  • If you would prefer not to work with pages in your application,
    pass the first page of the feed into
    Zend_Gdata_App::retrieveAllEntriesForFeed(), which
    will consolidate all entries from each page into a single feed.
    This example shows how to use this function:



    <?php
    $gdata 
    = new Zend_Gdata();
    $query = new Zend_Gdata_Query(
            
    'http://www.blogger.com/feeds/blogID/posts/default');
    $feed $gdata->retrieveAllEntriesForFeed($gdata->getFeed($query));



    Keep in mind when calling this function that it may take a long
    time to complete on large feeds. You may need to increase PHP's
    execution time limit by calling set_time_limit().