2

Our website has school info; when users login to our site with Facebook, we'd like to display a few photos of the user's friends who have attended the school.

The Facepile social plugin will show users who have Liked the school, but that appears to be different from adding the school to your education history. (For example, I haven't Liked my high school, but it appears in my user info.)

Is there some way to do this using the Graph API or FQL? e.g. given a school's page ID and a user's access token, is there some way to query for the user's friends by school?

Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175

2 Answers2

2

Thanks to omalleyt you can use an URL like this to query for all of a user's friends' education objects, which include IDs.

https://graph.facebook.com/me/friends?fields=name,id,education&access_token=blah
Dan Fabulich
  • 37,506
  • 41
  • 139
  • 175
-1

Unless I'm missing something, you should be able to get the list of people that has joined/liked the school's page, and you should be able to get the list of friends the user has. Once you have both lists, compare and find common entries in both lists. You should end up with a list of friends, that all joined/liked the school.

William
  • 772
  • 7
  • 18
  • Unfortunately, it's easy to see who has Liked the school's page, but that's completely different from who has attended the school. There seems to be no way to get a list of attendees. – Dan Fabulich Dec 09 '10 at 04:18
  • I assume the school page is a group, and if you look at the group api, there's a method of getting all the members as you can see here: http://developers.facebook.com/docs/reference/api/group – William Dec 09 '10 at 06:23
  • Don't just assume! ;-) A school is a Page, not a Group. It has a "category" (School) and a "fan_count"; it does not have a "privacy" property as Groups do. – Dan Fabulich Dec 10 '10 at 01:21
  • 1
    Alright, after digging some more i found this http://stackoverflow.com/questions/4018849/facebook-api-get-fans-of-people-who-like-a-page. – William Dec 10 '10 at 04:54
  • That link isn't relevant. The list of fans (aka the list of people who have Liked the school page) is different from the list of attendees. For example, I haven't Liked my high school, so I'm not a Fan, but it appears in my user info. – Dan Fabulich Dec 13 '10 at 00:39
  • I guess I'll have to accept defeat. I can't find anything about it, and it seems like it's a missing feature from the FB API, both the old and new ones. Want me to delete the answer? – William Dec 13 '10 at 06:52