按学校查找 Facebook 好友
我们的网站有学校信息;当用户使用 Facebook 登录我们的网站时,我们希望显示该用户的朋友在该学校就读的几张照片。
Facepile 社交插件将显示喜欢该学校的用户,但这似乎与将学校添加到您的教育历史记录不同。 (例如,我不喜欢我的高中,但它出现在我的用户信息中。)
是否有某种方法可以使用 Graph API 或 FQL 来执行此操作?例如,给定学校的页面 ID 和用户的访问令牌,是否有某种方法可以按学校查询用户的好友?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢 omalleyt 您可以使用这样的 URL 来查询用户朋友的所有
education
对象,其中包括ID。Thanks to omalleyt you can use an URL like this to query for all of a user's friends'
education
objects, which include IDs.除非我遗漏了什么,否则您应该能够获取已加入/喜欢学校页面的人员列表,并且您应该能够获取用户拥有的朋友列表。获得两个列表后,比较并查找两个列表中的共同条目。您最终应该得到一份朋友名单,所有这些朋友都加入/喜欢了学校。
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.