Details

This module is the opposite of the MarkupRSS module that comes with ProcessWire because that module creates RSS feeds. Whereas this module loads them and gives you easy access to the data to do whatever you want.

For a simple live example of this module in use, see the processwire.com homepage (and many of the inside pages) for the "Latest Forum Post" section in the sidebar.

RequirementsThis module requires that your PHP installation have the 'allow_url_fopen' option enabled. By default, it is enabled in PHP. However, some hosts turn it off for security reasons. This module will prevent itself from being installed if your system doesn't have allow_url_fopen. If you run into this problem, let me know as we may be able to find some other way of making it work without too much trouble.

You can also customize all output produced by the render() method,though it is probably easier just to foreach() the $rss yourself. Butsee the module class file and $options array near the top to see howto change the markup that render() produces.

MORE DETAILS============

This module loads the given RSS feed and all data from it. It then populates that data into a WireArray of Page-like objects. All of the fields in the RSS <items> feed are accessible, so you use whatever the feed provides.

For convenience and consistency, ProcessWire translates some common RSS fields to the PW-equivalent naming style. You can choose to use either the ProcessWire-style name or the traditional RSS name, as shown above.

HANDLING ERRORS===============

If an error occurred when loading the feed, the $rss object willhave 0 items in it:

$rss->load("...");if(!count($rss)) { error }

In addition, the $rss->error property always contains a detaileddescription of what error occurred:

if($rss->error) { echo "<p>{$rss->error}</p>"; }

I recommend only checking for or reporting errors when you aredeveloping and testing. On production sites you should skiperror checking/testing, as blank output is a clear indicationof an error. This module will not throw runtime exceptions soif an error occurs, it's not going to halt the site.