tags:

views:

92

answers:

2

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?

A: 

The user has to grant your application the user_likes permission before you can do that.

And if you're going to do while the user is not logged in, you'll need to prompt them for the offline_access permission as well.

http://developers.facebook.com/docs/authentication/

Peter Bailey
I have done both.The problem is when i am asking for the likes of the user 's friend.After a lot of tinkering I believe it s not doable though.
PanosJee
That requires the `friends_likes` permission I believe - I've not personally messed with any of the `friends_*` permissions before. Any reason you're not reading the connection from the graph, though? i.e., `/USER_ID/likes` ?
Peter Bailey
friends_likes perm is therei do not use the graph for the time being because of some legacy code, i ll have to upgrade to the graph anyway sooner or later
PanosJee
A: 

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.

daaku
friends_likes is there already :-/
PanosJee
You can't query **page_fan** after requesting **friends_likes**? My repro case works fine: http://fbrell.com/bugs/friends-pages
daaku

related questions