phpResource – My First Facebook Application
February 29, 2008 § 3 Comments
Today I developed a simple facebook application that reads and parses RSS from phpResource. It’s my first one during the first touch of facebook platform. See my first app here:
It’s very easy to add a facebook app. I want to share how easy it was to add an app in facebook. If you did not work on facebook app but want to develop your first one in an hour, here is a summary of working steps for you that will help you move very easily:
1. Go to http://developers.facebook.com/resources.php and download a client library. I downloaded PHP (4 and 5) client library.
So you have the “facebook-flatform” files(extracted from facebook-flatform.tar.gz) to work on. I put the files into a dir named “facebook” (renamed dir “facebook-platform” to “facebook”) in my web server.
2. Add facebook developer application (go to http://www.facebook.com/developers/ and see option to setup application). You will be given an app secret key and an api key. Note that these keys are very important.
3. Go to http://developers.facebook.com/step_by_step.php and read and follow their easier guidelines.
4. While you are following the guidelines as per step 3, you need to put value in “Callback Url” field. It’s the URL where you worked with “facebook-platform” files. For my case, it’s the “facebook” dir where I put the platform files. Before you put the callback URL, you need to do the following:
– write the sample code (into a file under platform dir “client”) provided in http://developers.facebook.com/step_by_step.php, don’t forget to use your key credentials. Say your filename is abcd.php
– write your target script which goes below the initial codes guided by http://developers.facebook.com/step_by_step.php. For my case, it was like following:
where phpresource.php has its own output. You can see it here:
Now you know what to put as the callback URL. It’s like http://www.yourdomain.com/facebook-platform/client/abcd.php, for my case it should be like: http://www.rupom.com/facebook/client/abcd.php (as I renamed “facebook-platform” to “facebook”).Save the settings and see your app URL. You are DONE!!
I will share more in future.