问题描述
我已经使用facebook graph api获取了facebook feed.我想获得每个供稿的评论计数和喜欢计数.我不想调用另一个URL来获取评论计数,例如喜欢计数,传递帖子ID来获取评论计数并且喜欢像下面的URL那样计数: https://graph.facebook.com//comments?access_token = ...
I have fetched the facebook feeds using facebook graph api.I want to get comments count and likes count for each feed. I don't want to call another url to get comment count and like count for example, pass post id to fetch comment count and like count like following url:https://graph.facebook.com//comments?access_token=...
请让我知道是否有任何方法可以获取所有Facebook提要,包括评论计数和单个API调用中的喜欢计数.
Please let me know if there is any way to get all facebook feeds including comments count and like count in single API call.
谢谢.
推荐答案
您可以使用FQL语句来获取用户供稿.我有一个FQL的示例,您可以从此FQL查询中删除不需要的内容(如条件).
You can use the FQL statement for fetching User Feed. I have an example of FQL, You can remove the things which you don't need from this FQL query (like conditions).
NSString *query =
@"{'posts':'SELECT actor_id,post_id, created_time,likes,comment_info,attachment FROM stream WHERE filter_key IN (SELECT filter_key FROM stream_filter WHERE uid = me()) AND (attachment.fb_object_type=\"photo\" OR attachment.fb_object_type=\"video\" OR strpos(attachment.href, \"youtu\") >= 0) LIMIT 20','userinfo':'SELECT uid, name, pic_square FROM user WHERE uid IN (SELECT actor_id FROM #posts)','pageinfo':'SELECT name,page_id, pic_square FROM page WHERE page_id IN (SELECT actor_id FROM #posts)',}";
希望有帮助.
这篇关于Facebook图形API可获取具有评论计数和赞计数的Facebook提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!