Simple PHP Facebook scripts

About the client

Australia

Posted on Jan 07, 2012 / Est. budget $ 50 / Project closed

Background:

I have a Facebook page that has a lot of fake profile fans on it. I need two scripts that will help me identify which fans are fake and remove them from my page.

There two scripts required: (1) the FanLister and (2) the FanRemover




INPUT/UI:

** FanLister **
- I want a PHP script that I can run on my mac and call (Get request) from my web browser like this:
http://localhost/fanlister?userid=simonlj%40domain.com&password=password&pageid=1234567&limit=500

** FanRemover **
- I want a simple web form that has one textarea input box and a submit button. The textarea input box will allow me to input Facebook IDs separated by a smicolon




FUNCTION

** FanLister **
- The fan lister will use the Facebook graph API to get all the users that like my page, ie:
https://graph.facebook.com/[PAGEID]/members?limit=500&access_token=[oauthtoken]

- The fan lister will then fetch the following information for each user:

USER:
https://graph.facebook.com/[USERID]
first_name, last_name, locale, updated_time, timezone, education, hometown, location

MUSIC:
https://graph.facebook.com/[USERID]/music
name

FRIENDS:
https://graph.facebook.com/[USERID]/friends
id

- The fan lister will then compare the friends of each user and that user's ID with the friends of every other user to determine if there are any friends or mutual friends


** FanRemover **
- The fan remover will use the Facebook graph API to block the list of users submitted in the form, ie
https://graph.facebook.com/[PAGEID]/blocked



LOGGING

For both scripts I want simple logging I can tail to check the status, eg:

FanLister 2012-01-10 13:05:01 Sending request https://graph.facebook.com/FanLister/music... returned OK
FanLister 2012-01-10 13:06:01 Sending request https://graph.facebook.com/FanLister/music... returned OK
FanLister 2012-01-10 13:07:01 Sending request https://graph.facebook.com/FanLister/music... returned OK



OUTPUT

** FanLister **

I want a Windows CSV file generated, see example attached.

"friends" is the list of ids that like the page AND are friends with this user
"mutual friends" is the list of ids that like the page AND have friends in common with this user

Notice that fields with multiple/listed values shoudl use a semi colon to separate values.




** FanRemover **

No output required




OTHER

This does not need to run quickly, there should be a sleep/pause of at least a few seconds between requests. I do not want to overload the facebook api

It might be better to do batch requests, see:
http://developers.facebook.com/docs/reference/api/batch/

This MUST be thoroughly tested first before I receive it

Project bids (2)

Bids are visible only by project owner and Premium members.