如何编写FQL来获取新闻提要 [英] How to write FQL to fetch news feeds
问题描述
我必须获取新闻源(公共墙上)上的所有数据.我应该写什么查询?
我写了"SELECT likes,message FROM stream WHERE source_id = %lld limit 50 "
查询,但它返回了我的墙值.我想获取墙上和公共(新闻源)上的所有数据.
I have to fetch all data which is on News Feeds (public wall). What query should I write ?
I wrote "SELECT likes,message FROM stream WHERE source_id = %lld limit 50 "
query but it is returning my wall value. I want to fetch all data which is on my wall as well as on public (News Feed).
预先感谢
推荐答案
您需要使用filter_key
选择要使用的供稿类型.您所追求的类型可能是newsfeed
,因此查询可能是这样的:
You need to use the filter_key
to select the type of feed to use. The type you are after would probably be newsfeed
, so the query could be something like this:
SELECT post_id, actor_id, target_id, message FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = me() AND type = 'newsfeed')
有关更多信息,请查看 stream_filter文档.
For more information, have a look at the stream_filter docs.
这篇关于如何编写FQL来获取新闻提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!