Plugin Directory

Fetch Feed

Fetches an RSS feed and returns RSS as array

General Usage

fetch_feed_cache() is the only function you will be using with this plugin. fetch_feed_cache() accepts 2 parameters.

  1. (string) $url - This is the URL to the feed you would like to parse
  2. (int) $cache_min - This is the amount of time in minutes you would like the feed cached for.

Here is an example of the plugin being used in a template:

<?php $xml = fetch_feed_cache("http://jrtashjian.com/feed/", 60); ?>
<h3><?=$xml->channel->title?></h3>
<ul>
    <?php if( ! empty($xml)) : ?>
        <?php foreach($xml->channel->item as $item) : ?>
            <li><a href="<?=$item->link?>"><?=$item->title?></a></li>
        <?php endforeach; ?>
    <?php else : ?>
        <p>Delicious doesn't seem to be working at the moment...</p>
    <?php endif; ?>
</ul>

Remeber, every feed could be different. If you need to see the structure of the object returned just use print_r(). Example: <?php print_r(fetch_feed_cache("http://jrtashjian.com/feed/", 25)); ?>

Requires: 2.5 or higher
Compatible up to: 2.8
Last Updated: 2009-8-11
Downloads: 3,143

Average Rating

5 stars
(3 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
100,1,1
100,2,2