如何通过 Facebook API 获取好友点赞
这可以得到我所有朋友的喜欢吗?现在,我通过两个步骤得到了这个:
- 获取我所有的朋友列表
- 通过迭代这些列表,我得到了所有个人的喜欢,
但这似乎是一个非常大的过程,有人有想法提高这项任务的性能吗?
Is this possible to get all my friends likes?? Now, I'm getting this by 2 steps:
- Getting all my friends list
- By iterating those list I'm getting all individuals Likes,
but it seems very big process, anybody have idea to improve the performance for this task?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用
FQL
将比循环遍历 Graph API 结果更快。您可以获得朋友喜欢的页面的 ID,但不幸的是FQL
不会返回除此之外的信息(即名称)。看看下面的内容。这假设您使用具有 friends_likes 权限的 PHP SDK。
这样做的好处是您只需进行一次 API 调用。您必须分别拨打电话来获取好友姓名,并拨打另一个电话来获取喜欢的页面详细信息,但您现在可以通过直接的方法使用 ID。
Using
FQL
is going to be faster than looping through the Graph API results. You can get the ID of the pages your friends like, but unfortunatelyFQL
does not return info other than that (ie the name). Take a look at the following.This assumes you are using the PHP SDK with the friends_likes permission.
The benefit of this is that you only make one API call. You will have to make separate calls to get the friend names and another for the liked page details, but you have the IDs to work with now in a straight forward approach.
我相信这是唯一的办法。几周前我看过这个问题。不要认为他们改变了 API。
http://developers.facebook.com/docs/reference/api/
编辑:
我不确定我是否足够理解你的意思...如果你的意思是你想获取用户喜欢的帖子列表,你要做的是:
这是您想要的吗?
I believe that is the only way. I looked at this problem a few weeks ago. Don't think they've changed the API.
http://developers.facebook.com/docs/reference/api/
EDIT:
I'm not sure I understand well enough what you mean... If you mean that you want to get a list of the posts that a user likes, what you have to do is this:
Is that what you want?
我在查看 Facebook API 文档 2 周后终于找到了它
At last I found it after 2 weeks looking at Facebook API documentation