How To Set Up A Facebook RSS Feed Reader Application For Your Blog

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Sun, 2007-09-02 17:25. :: PHP

How To Set Up A Facebook RSS Feed Reader Application For Your Blog

Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 08/31/2007

This guide shows how you can build an RSS feed reader application for the social network Facebook that will display your blog's/web site's RSS feed on the profile pages of Facebook users (that have installed the RSS feed reader application). Each item of the RSS feed will have a Share button so that people can share the story with their friends, and the application will have an Invite link so that people can invite up to ten friends at once to also install this feed reader application. I will use PHP5 to build the RSS feed reader application. To parse the RSS feed and generate HTML from it, I will use Magpie RSS.

You can see this application in action by installing the HowtoForge RSS Feed Reader for Facebook.

This document comes without warranty of any kind! I do not issue any guarantee that this will work for you!

 

1 Preliminary Note

This guide is based on a real-world example, the HowtoForge RSS Feed Reader for Facebook, and I will use the real URLs and scripts in this example (only replacing secret data like the API key and the Secret).

As I mentioned before, I'm using PHP5 to build this application, using Facebook's PHP Client Library. Theoretically you can use PHP4 as well, but the client platform is optimized for PHP5, so you should use that if possible.

I'm using the host fb.howtoforge.com in this example to host the application; it is a PHP5 capable web site.

Before you can start writing your own Facebook application, you must register on Facebook (if you don't have an account yet) and add the Facebook Developer Application to your account, as described on http://developers.facebook.com/get_started.php:

Afterwards, you should start with these examples to get used to creating Facebook apps. However, I will use these examples in this tutorial again (at the beginning) to make sure that everything is working as expected before I try to write my own stuff.

 

2 Set Up A New Application

Before we start programming our application, we must tell Facebook about it, and Facebook will then give us an API Key and a Secret which we need to build the application.

Now that you've added the Facebook Developer Application to your account, go to your Facebook page - you should now see the Developer app in the left navigation. Click on it. The Developer page opens, where you click on the + Set Up New Application button (near the upper right corner):

Now we're on the New Application page. I want to name my app HowtoForge RSS Feed Reader, so I fill this in as Application Name. I check the checkbox below this field to show that I agree to the terms of the Facebook platform. Then I fill in a support email address (should be an address where you or your fellow developers can be contacted). The Callback URL is the location where the app will be hosted. Mine will be hosted under http://fb.howtoforge.com/fb/htf_feed_reader/, so I fill that in. The Canvas Page URL is the Facebook address you'd like your app to have. Fill in your desired address (e.g. http://apps.facebook.com/htf_feed_reader), and the form will then tell you if the address is still available or not. Then select Use FBML and Website (both should already be the default selection):


One important note regarding the Callback URL: It is absolutely important that the URL ends with a slash (/); if it doesn't, people will later on get the famous The URL ... did not respond. error whenever they visit your app in their accounts, like this:


Next, still on the New Application page, fill in the other options. Answer Can your application be added on Facebook? with Yes. You can leave the TOS URL field empty if you don't have any terms of service. Add additional developers if there are any. As Post-Add URL, you use the Canvas Page URL (http://apps.facebook.com/htf_feed_reader in my case). Fill in a description for your application. The Post-Remove URL can be left empty as well. In the Default FBML field, you can enter some text that you would like to appear on the user profiles if your app doesn't deliver content for the profile page. Then select in which profile column you'd like your content to appear. As there's lots of text in RSS feeds, the wide column is a good choice in our case:

Further down on the New Application page, there's just on other field we must fill out, the Side Nav URL. Again, this is the same as the Canvas Page URL (http://apps.facebook.com/htf_feed_reader in my case). All other fields can be left empty. Click on Submit afterwards:

You should now be on the My Applications page where you can find the API Key and the Secret for your app. Copy them, we'll need them for our app later on.

Further down on the My Applications page, you will see a link to the PHP (4 and 5) Client Library:


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.
Submitted by Pat Urmaine (not registered) on Tue, 2011-05-10 12:50.

Facebook always seems to change things around. Now you can use the Facebook Notes Application to add an RSS or ATOM feed to your page. The only drawback with this method is that it only allows you to add one single feed.  You can see more info about this process here: http://www.soflaweb.com/blog/article/how-to-add-your-rss-feed-to-your-facebook-page

Submitted by juzhax (not registered) on Sat, 2010-10-09 08:07.

The solution above has been outdated. I'm using this to solve my RSS http://www.justin.my/2010/09/how-to-import-rss-feed-to-facebook-page/

Submitted by KC (not registered) on Sun, 2009-01-04 00:39.

This tutorial is excellent, but it appears to refer to the 'old' version of Facebook.

As a result if you try to run the application it creates using 'new' Facebook you get errors of the type:

"No content to display. This box will not be visible to people who view your Profile until this application adds content to it."

Has anyone had success adapting this tutorial for 'new' Facebook?

Submitted by alienmau (registered user) on Thu, 2010-05-27 18:47.
yeah me too, this do not work now for the new version of the librery, so??? can you help us telling us how to solve this issue?