Extension:SimpleFeed

What can this extension do?
This extension outputs the contents of an RSS feed. It is very customisable and no output format is forced on the user. As a result, no editing of the PHP source is required as everything is done in the wiki page. This extension uses the SimplePie PHP feed-parsing library.

Todo
The following feature(s) will be added shortly:
 * Check whether the URL given is a correct address. If SimplePie can't read it, output something.
 * Clean up the regular expressions.

SimplePie version problem
IMPORTANT: For the latest version of SimplePie you need to change: $feed->feed_url($args['url']); TO: $feed->set_feed_url($args['url']);

Usage
There are two arbitrary fields that must be present. These are the url argument, and the content between the  [...]  tags. A simple example is shown below:



[{PERMALINK} {TITLE}]
{DATE}, by {AUTHOR} {DESCRIPTION}

This will pull the BBC News feed and output five posts. For every post, it will output the data between the feed tags, replacing {PERMALINK}, {TITLE}, {DATE}, {AUTHOR} and {DESCRIPTION}</tt> with the appropriate information.

Customisation
The following arguments can be used to customise the output:


 * url
 * The URL of the feed. This argument is not optional.


 * entries
 * The number of post entries to output. This defaults to 5, but can be any number. 0 is unlimited.


 * type
 * If this is set to "planet</tt>" then the post title and author will be retrieved from the title. For example, a post in a planet/aggregator could have a title "Joe Bloggs: MediaWiki is great". If type="planet"</tt> is set, then {TITLE}</tt> will become "Mediawiki is great", and {AUTHOR}</tt> will become "Joe Bloggs".


 * date
 * The format of the date to output. This conforms to PHP's date function syntax. This defaults to j F Y</tt> (E.g. 3 March 2007).

Further examples
Using an aggregator's feed <feed url="http://planet.debian.org/rss20.xml" type="planet">

[{PERMALINK} {TITLE}]
{DATE}, by {AUTHOR} {DESCRIPTION} This will remove the author's name from the title of the post, and setting its value to {AUTHOR}</tt>.

Changing the date format <feed url="http://planet.debian.org/rss20.xml" date="h:i:s d/m/y T">... Changes the date format to, in this example, "23:20:04 24/03/2007 GMT".

Installation
Download this file and save as SimpleFeed.php</tt>. Place it into the includes/</tt> directory. You need to also download the SimplePie library from http://simplepie.org/. You only need simplepie.inc</tt>, and if this file is placed into includes/</tt> then no more changing will be required.

Parameters

 * Line 32: $simplepie_path</tt> - string: Path to simplepie.inc</tt>, including leading forward slash. For example:
 * $simplepie_path = 'extensions/';

Changes to LocalSettings.php
Add the following to the end: include("$IP/extensions/SimpleFeed.php");