Facebook Api:获取用户通过我的应用程序获得的帖子的点赞数
我使用 facebook-connect 让用户使用他们的 facebook 帐户登录。我还请求他们有权在他们的墙上发布帖子。现在我喜欢做以下事情: 如果我的应用程序以其用户名发布在用户墙上,我喜欢记住这篇文章,并在稍后计算这篇文章收到的点赞和评论的数量。
我怎样才能做到这一点?
I use facebook-connect to let users login with their facebook-account. I also ask them for the right to publish posts on their wall. Now I like to do the following:
If my app posted on a users wall in their users name, I like to remember this post and at a later point count the number of likes and comments this post received.
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这应该不是很困难。根据我的理解,让我概述一下完成此任务的步骤:
1) 当您向用户墙发帖时,您将得到 post_id
2) 您必须在最后保存此 post_id跟踪通过您的应用发布的所有帖子
3) 接下来,任何时候您想要查找该帖子的点赞数 - 您都可以运行此 FQL 查询,该查询将返回给定 post_id 的所有点赞
select post_id, user_id from like where post_id ="5XXXXX107_17XXXXXXXX664"
4) 要查找给定帖子的评论,请使用此 FQL
SELECT post_id,message,comments FROM stream where post_id ="5XXXXX107_17XXXXXXXX664"
您可以在这里测试这些查询
http://developers.facebook.com/docs/reference/rest/fql。 query/
如果您需要更多详细信息,请告诉我祝
你好运
I dont think this should be very difficult. Based on my understanding, let me outline the steps using which you can accomplish this tasks:
1) From your when you make a post to the users wall, you will get back the post_id
2) You will have to save this post_id at your end to keep track of all the posts made through your app
3) Next, anytime you want to find the number of likes to that post - you can run this FQL query which will return all the likes for the given post_id
select post_id, user_id from like where post_id ="5XXXXX107_17XXXXXXXX664"
4) To find the comments for a given post, use this FQL
SELECT post_id,message,comments FROM stream where post_id ="5XXXXX107_17XXXXXXXX664"
You can test these queries here
http://developers.facebook.com/docs/reference/rest/fql.query/
Let me know if you need more details
Good Luck