Now that you've gained a small insight into how Facebook applications work, we can start to build our RSS Feed Reader. First, we need some kind of script that can parse RSS feeds and help us create HTML from it. A great tool to do this is MagpieRSS (written in PHP). Please read this tutorial to learn how MagpieRSS can be used (I won't go into the details here): Easy RSS Syndication with MagpieRSS
Now let's download and install MagpieRSS in a subdirectory of our Feed Reader app, /var/www/fb/htf_feed_reader/rss:
tar xvfz magpierss-0.72.tar.gz
cp rss_* ../
cp -fr extlib/ ../
rm -fr magpierss-0.72*
Next, we create a cache directory (where MagpieRSS can cache the feed if you want to use this feature) called magpie_cache and make it world-writable so that the Apache user (or the user running the PHP scripts if you use suPHP) can write to it:
chmod 777 magpie_cache
Now let's integrate MagpieRSS into our index.php script (take a look at Easy RSS Syndication with MagpieRSS for an easy feed reader - the following script already uses RSS caching and CSS styling):
Please replace the URL in $rss = @fetch_rss('http://www.howtoforge.com/node/feed'); with your own RSS URL.
As you see, I'm caching the RSS feed here for 10 minutes (600 seconds). If you don't like caching, you can change define('MAGPIE_CACHE_ON', 1); to define('MAGPIE_CACHE_ON', 0);.
I'm also using an interesting FBML feature here, the Share button. Using the
<fb:share-button> syntax, you can place Share buttons next to single items of our feed and allow Facebook users to tell their friends about something interesting they've found in your feed. Take a look here to learn more about the Share button: