Making a dynamically updating blogroll for Wordpress (or anywhere else)

Requirements

  • SimplePie feed parsing library (included below)
  • A host that supports Simplepie's features (must be able to fetch remote URLs. I am using 000webhost.com currently, who are free, and seem to work)
  • The RSS feed widget on Wordpress
  • My script
  • Instructions

  • Download this zip file. It includes SimplePie 1.1.3, and my script
  • Extract it somewhere locally on your computer.
  • Open feed.php with a text editor (notepad is sufficient) and change the text of the top three variables to suit your liking
  • Open feedlist.txt and insert some URLs to RSS/Atom feeds (one per line)
  • Upload each file onto your web server (use FTP so you don't have to create the dir structure)
  • Make sure the cache directory is server writable -- On 000webhost this seems to mean setting the permissions to 777
  • Browse to http://www.youraddress.com/feed.php and hope it's now showing a valid XML page :P
  • Set http://www.youraddress.com/feed.php as the address of the feed for your RSS widget on Wordpress
  • Troubleshooting

  • Check SimplePie's compatability test page to determine if your host is adequate, this can be found on http://www.youraddress.com/simplepie/1.1.3/compatibility_test/sp_compatibility_test.php
  • Check SimplePie's demo to see if it can fetch any feeds: http://www.youraddress.com/simplepie/1.1.3/demo/?feed=http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml and see if that displays the BBC news headlines down the page, without errors
  • If you are seeing a lot of 'permission denied' errors on feed.php that probably means that your cache directory isn't writable -- how you rectify this depends on your host
  • Known issues

  • The default behaviour is to leave images within feed items (editable on line 9 of feed.php), but Wordpress seems to remove them anyway
  • Using Blogger's RSS feed will give some peculiarities in SimplePie 1.1.3 pertaining to the publication date getting mixed up with the edit dates (it looks like Blogger inserts Atom code into the RSS feed and this confuses SimplePie). Use the Atom feed instead.