LastRSS. MagpieRSS. Neither have been updated in over a year. What’s the best way to parse RSS feeds and output them with PHP? Simple, use SimplePie.
What is SimplePie? It’s a file you include in your PHP scripts, allowing you instant access to RSS-parsing capabilities. You can display RSS headlines/items on your website, combine several feeds into one, and anything else that you can think of. If you know a little PHP, the possibilities are endless.
You see this PHP code:
require('simplepie.inc');
$feed = new SimplePie("http://feeds.feedburner.com/Webmaster-source");
$feed->handle_content_type();
echo "<h1>".$feed->get_title()."</h1>";
foreach ($feed->get_items() as $item) {
echo '<h2><a href="'.$item->get_permalink().'">';
echo $item->get_title().'</a></h2>';
echo '<p>'.$item->get_description().'</p>';
}
That’s all you need to display a feed’s headlines and descriptions. Of course, that was only a simple example. It’s unbelievable what you can do with SimplePie.
Over at NTugo, SimplePie is used extensively. The MyNT RSS reader is powered by SimplePie. The “Recent blog posts” and “Recent posts from the NTugo Network” boxes on the home page are built with SimplePie. The RSS feed aggregated from all of the NTugo blogs? SimplePie again! It’s amazing what you can do with SimplePie.
If you know PHP, you’ll definitely want to take a look at SimplePie.