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:
mkdir /var/www/fb/htf_feed_reader/rss
cd /var/www/fb/htf_feed_reader/rss
wget http://mesh.dl.sourceforge.net/sourceforge/magpierss/magpierss-0.72.tar.gz
tar xvfz magpierss-0.72.tar.gz
cd magpierss-0.72
cp rss_* ../
cp -fr extlib/ ../
cd ..
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:
cd /var/www/fb/htf_feed_reader
mkdir magpie_cache
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:
Please do not use the comment function to ask for help! If you need help, please use our forum. Comments will be published after administrator approval.
Recent comments
6 hours 54 min ago
7 hours 22 min ago
10 hours 5 min ago
10 hours 57 min ago
12 hours 3 min ago
13 hours 36 min ago
16 hours 10 min ago
21 hours 4 min ago
22 hours 28 min ago
22 hours 58 min ago