0

Forgive me if this has been answered before, but looking at the questions asked I did not see my answer already in StackOverlow. I am an experienced PHP programmer getting to know the Facebook API. I think the FQL implementation is pretty freaking cool. My knowledge of SQL statements will make the learning experience very smooth. However, Facebook's documentation seems to negate that a few times. I see a list of objects I can query, but I feel like the list is missing certain relational objects. For example: I wish to get a list of the authenticated user's friend_list and the user's friends that pertain to each of the lists. I can successfully retrieve an authenticated user's friend list and a list of their friends, but how do I get a list of the authenticated user's friends that pertain to each of his friend_lists objects?

Angel S. Moreno
  • 3,469
  • 3
  • 29
  • 40

2 Answers2

0

Ok, so further research has led me to find a complete list of the tables part of the FQL database. this can be found here : http://developers.facebook.com/docs/reference/fql/ on the left hand side is a list of tables and lo and behold, there a relational table for friends and friendlist called friendlist_member. So at this point I can get a list of the friendslists created by the authenticated user and then do another query to get a list of ids of the users in that friendlist. Finally I do a final query to get details like name and photos of those users.

Angel S. Moreno
  • 3,469
  • 3
  • 29
  • 40
  • Hi Angel, I am doing with the same getting members for a friend-list, but no luck till yet. Can you post some code how do I get members list. – Richa Nov 19 '13 at 09:19
  • `SELECT flid, name, count, type from friendlist where owner = me()` gets you all the friend lists owned by the logged in user. `select uid, flid from friendlist_member WHERE flid in(select flid from friendlist where owner = me())` gets you the list of each user id and friend list id. Next you would get the profiles of each user id as a bulk . Finally you glue those 3 arrays. All that being said, I think the graph does a better job at getting the information in one batch: `/me?fields=friendlists.fields(id,name,list_type,members.fields(id,name,pic_small))` – Angel S. Moreno Nov 19 '13 at 15:48
0

Use the following fql:

SELECT flid, owner, name FROM friendlist WHERE owner=me()

For more details,

http://developers.facebook.com/docs/reference/fql/friendlist/

Soojoo
  • 2,146
  • 1
  • 30
  • 56