Get users' Facebook Likes with FQL

PanosJee picture PanosJee · Jul 9, 2010 · Viewed 12.5k times · Source

Hello everyone I am trying to get my friends 's likes on FB using FQL

'SELECT name,type FROM page WHERE page_id IN (SELECT target_id  FROM connection WHERE source_id=%i and target_type="Page") AND type!="APPLICATION"'%(friend.fb_uid))

The query works as expected when I am asking for my own likes but return nothing for my friends. I have added the likes permission but still nothing.

Any ideas?

Answer

daaku picture daaku · Jul 10, 2010

The page_fan table here http://developers.facebook.com/docs/reference/fql/page_fan might work for your use case (I'm going to check why the connections table has different behaviour). Try something like:

'SELECT name, type FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid=%i) AND type != "APPLICATION"'%(friend.fb_uid)

This is of course after asking for the friends_likes permission.