I want to write a WordPress plugin that will fetch ‘updates’ of my friends or pages I like on facebook.
- Is that doable in PHP?
Any code sample? I tried to look at Facebook for Websites but didn’t find and example on how to get the updates.
- Any suggestions how this could be done?
OK. Let’s start by the beginning. You can do this, sure. Facebook API is growing and you can do it for a very simple way, using “FQL”.
Following the code (based on the facebook example):
The code above require an application registered at facebook (You can register on at https://developers.facebook.com/apps). Just register there and replace the appId and the secret with your values.
After all this done, you must echo the url $loginUrl to get the AuthToken of your user. With this token, you can get all the updates of him (using the fql of the example).
The Facebook type used in here is available at https://github.com/facebook/php-sdk.
I hope this helps or at least have given a path.
Status FQL Docs:
http://developers.facebook.com/docs/reference/fql/status/
API Method Docs (my example was based in here):
http://developers.facebook.com/docs/reference/php/facebook-api/