新的Facebook API获取新闻源及其评论 [英] New Facebook API fetching newsfeed and its comments

查看:142
本文介绍了新的Facebook API获取新闻源及其评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过Facebook在2013年7月的新变化来获取新闻资讯及其评论 - https: //developers.facebook.com/roadmap/



我试图做什么?



我想用一个api调用获取最新的新闻源(如果有任何评论),即使它的组api调用。



旧方式:



1)从具有注释字段的流表提取(注释字段现在已被弃用)



2)从带有注释字段(现在也被删除)的图形提取






快速链接




解决方案

如何使用fql?您不再担心,因为您需要的是从流中获取 post_id

  {query1: SELECT post_id,actor_id,created_time,message FROM stream WHERE filter_key in(SELECT filter_key FROM stream_filter WHERE uid = me()AND type ='newsfeed')AND created_time< = now()LIMIT 5,query2:SELECT post_id ,id,fromid,time,text,user_likes,likes FROM comment WHERE post_id IN(SELECT post_id FROM#query1)LIMIT 5,query3:SELECT id,name,pic_square FROM profile WHERE id IN(SELECT actor_id FROM#query1 )或id IN(SELECT FROMID FROM#query2)} 

请使用图形API资源管理器 2013年7月份更改的设置已启用),它的工作原理如预期(当然,您需要授予权限 read_stream )。


is there a way to get newsfeed and its comments with the new changes facebook making on july, 2013 - https://developers.facebook.com/roadmap/

What im trying to do?

i want to fetch latest newsfeed with comments (if any comments on it) with one api call, even if its group api call.

Old Way of doing it:

1) fetching from stream table with comments field (comment field is deprecated now)

2) fetching from graph with comments field (which is removed also now)


Quick Links

解决方案

How about using fql? You no longer worry because what you need is get post_id from stream:

{"query1":"SELECT post_id, actor_id, created_time, message FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND created_time<=now() LIMIT 5 ","query2":"SELECT post_id, id, fromid, time, text, user_likes, likes FROM comment WHERE post_id IN (SELECT post_id FROM #query1) LIMIT 5 ","query3":"SELECT id, name, pic_square FROM profile WHERE id IN (SELECT actor_id FROM #query1) or id IN (SELECT fromid FROM #query2)"}

Please test with graph API explorer(migration settings of "July 2013 Breaking Changes" is enable), it works as expected(Of course, you need granted permission read_stream).

这篇关于新的Facebook API获取新闻源及其评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆