How To Set Up A Facebook RSS Feed Reader Application For Your Blog - Page 3
5 Build The Feed ReaderNow 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 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 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): vi /var/www/fb/htf_feed_reader/index.php
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: http://wiki.developers.facebook.com/index.php/Fb:share-button Now let's visit our application's canvas page again. If you've done nothing wrong, you should now see your RSS feed: Go to your profile, and you should see the RSS feed there as well: Congratulations, your feed reader is working!
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com
Red Hat Virtual Experience - a free virtual event. Dec. 9th







print: 
Recent comments
11 hours 43 min ago
17 hours 31 min ago
19 hours 23 min ago
21 hours 7 min ago
1 day 58 min ago
1 day 6 hours ago
1 day 6 hours ago
1 day 11 hours ago
1 day 16 hours ago
1 day 22 hours ago