MagpieRSS is a library that provides an XML-based RSS parser in PHP. It is written by Kellan Elliot-Mcrea.
Fetching the remote RSS newfeed, parsing it, and caching the results are all transparently supported behind a simple functional interface.
There are a number of alternative RSS-Libraries for PHP, including lastRSS.php, PEAR::XML_Feed_Parser, PEAR::XML_RSS, rss2array, SimplePie, and PHP RSS News Parser.
However MagpieRSS is widely considered to be the most robust option, with SimplePie coming as a second best with the less restrictive LGPL license and a few additional features.
AOE media, a TYPO3 & open source provide from Germany, recently agreed to become a sponsor on Magpie. Which is very exciting!
Looking around I see being sponsored by AOE Media puts me in good company as they sponsor a number of interesting projects, including my favorite wiki software Doku
I’m hoping this will allow me to actually spend a little time with Magpie, maybe finally find the time to re-vamp the website into something a little more functional.
And last if you’re someone interested in sponsorship work as a whole on Magpie, or specific feature development get in touch.
Thanks again AOE Media.
MagpieRSS isn’t perfect, there are a number of issues with using it.
<category> tags correctly, it concatenates all the category strings into a single long category instead of making an array of categories.???? ???? characters. To resolve this, add define(“MAGPIE_OUTPUT_ENCODING”, “UTF-8”); to Magpie.<dc:subject> would map to an array subject in an array dc. This can result in collision if a real encapsulating element name collides, ie <dc><subject/></dc>. This is intentional, as MagpieRSS intends to make dealing with namespaces less complicated.Note: Some of these issues are by design. Namespace simplification in particular makes it easier to work with RSS feeds.
Also a development build is available that addresses some issues as MagpieRSS progresses towards version 0.8.
magpieRSS
issues
MagpieRSS makes it quite easy to fetch RSS feeds in PHP.
To get an array of RSS items from an RSS URL:
require('rss_fetch.inc');
$rss = fetch_rss($url);
$rssItems = $rss->items;
That’s it!
do a var_dump on the $rss->items array to see the RSS feed in MagpieRSS’s simple array structure.
PHP
Hello-World
magpieRSS