views:

1383

answers:

4

Hi everyone,

I'm trying to grab the names of fans of a Facebook fan page that I administer. I've done some snooping around, and apparently, the FB API doesn't support that, but Facebook actually uses AJAX/JSON to populate the list. Anyways, can anyone suggest a way to make that call myself and grab the data as plain text?

Also, I've found a hack that a guy wrote in Ruby, but I am completely unfamiliar with the language.

Thanks for the help in advance!

A: 

Using FQL (The Facebook query system) you probably are able to get that information. Keep in mind that there are several ways of retrieving data from facebook all of which are highly documented on their developers wiki.

Back to the query it should look something like this:

SELECT uid FROM page_fan WHERE page_id = <page_id> 

Facebook Query Language, or FQL, allows you to use a SQL-style interface to more easily query the same Facebook social data that you can access through other Facebook API methods (assuming your application has access!).

Pagefan Docs

johnnyArt
Thank you for pointing me in the right direction! I did run into a problem (see below) because FQL requires that you specify an indexable column in the WHERE clause. As it turns out, `page_id` isn't indexable. `SELECT page_id FROM page_fan WHERE uid = <some user id>` lists the `page_id` of all the pages of which a user is a fan. Theoretically you could go through every single FB user and see what pages they are fans of and then see which users have a given page_id in their list. A little impractical, as discussed here: http://wiki.developers.facebook.com/index.php/Talk:Page_fan_(FQL)
saibot
page_id isn't indexable at the moment, which means this doesn't work. It shouldn't really be an accepted answer..
Tim Haines
A: 

SELECT first_name, last_name FROM user WHERE uid IN (SELECT uid FROM page_fan WHERE page_id = [your page id]) should work, but I get an error trying to run this through the .net facebook api...something about the where clause not being on an indexable column, which it is.

Perhaps give that a try on your platform.

ScottE
Nah, the page_id isn't an indexable column on the page_fan table. As seen here: http://developers.facebook.com/docs/reference/fql/page_fan. Only * columns are indexed.
ajbeaven
+1  A: 

At the current time the FQL schema would suggest that there is no way to get a collection of FANS for any given PAGE. I think they are hiding this information because they display the FANS on the page... One would think that at least the ADMIN would have privileges to see the list of users.

Anyway... I hope someone make is possible in the near future.

Richard
A: 

That one worked 'SELECT user_id FROM like WHERE object_id="YOUR PAGE ID"'

nganassan