In this article I am going to show you how you can update your Facebook status using simple PHP code and Facebook Graph API. This is the most naïve way to use this, you can extend this to make your own script to update your status from mobile, via cron job, via email or whatever you think makes sense
Ok let’s get started now ! To be very frank, the status update script is already there in the SDK provided by Facebook, but very few people know. And there are people who won’t even know how easy it is.
First step is to create your APP in Facebook, let me show you how you can do that.
You can download the latest version of SDK from https://github.com/facebook/php-sdk/ and hit download. The app information page also has a guide to make a clone of this git repo, but if you do not want to get yourself into all that. Simply hit download button from https://github.com/facebook/php-sdk/ and you should be good to go.
I have downloaded the latest version which is 2.1.2 till date. Extract the contents of this zip file and you should see three folders along with a readme file. We are going to use src folder which has the necessary code to interact with the Facebook API. Upload this folder to the http://yourdomain.com/fb-app-folder
Next step is to create your file which will update the status, let’s call it as index.php since it’s the default file which will be picked from the folder. You can download the file index.php and save it in the same folder. All code is commented for proper understanding.
A simple way to quick start is download the ZIP FILE of all the code and extract it to the folder which you specified in the step 5.2
You can refer to Facebook reference API for more functions and play around with the API.
Stay Digified !!