tags:

views:

163

answers:

3

Our business has a Facebook Fan Page. The fan page doesn't seem to generate any emails to us when updates are made to the page, whether someone adds a new status or someone comments on one of the statuses etc.

Currently, we are running a very crude script to grab the content of the page and then use regular expressions to get the information we require. Obviously this is not fool proof and I'm looking into alternatives to this method.

I've been looking at the facebook API and wonder if the rest server might be an option. I cannot, however, seem to find out how to return information of fan page statuses and their comments. Is anyone able to direct me how to use the API to retrieve this information. I am an admin of the fan page. The programming language I'm using is PHP.

Many thanks.

A: 

I found my solution in using Facebook's FQL, which I have used through their API

Simon R
A: 

I'm looking to do something similar. Can you share a little about how you accomplished this?

Trash
set_time_limit(120);// include facebook wrapperrequire_once ('facebook.php');// secret keys$appapikey = '<your api key>';$appsecret = '<your secret key>';// create new class wrapper$facebook = new Facebook($appapikey, $appsecret);// get ordered comments$comments = $facebook->api_client->fql_query('SELECT xid, object_id, post_id, fromid, time, text, id, username, reply_xid FROM comment WHERE post_id IN (SELECT post_id, actor_id, created_time, message FROM stream WHERE source_id = <page_id> limit 10) ORDER BY time DESC');
Simon R
The results ($comments) are an array - you can foreach the array and get the relevant info from it and email it out ..
Simon R
A: 

Actually the list of messages at page named not "comments" but "stream posts". so you should retrieve that postings via Stream.get

zerkms