使用 FQL 将新闻源过滤为特定类型
我正在尝试提交对发送到用户新闻源的特定类型状态的查询,其中 type=video。我基本上想要为用户发布的所有视频,包括那些不是由 FB 托管的视频(否则我会提交视频查询)。如果我能让 FB 不返回除视频之外的任何内容,我会很高兴,但我当然没有看到解决方案。我没有看到返回的查询甚至有一个包含此信息的字段,以便我可以过滤返回的信息。流表中是否有任何字段可以告诉我帖子的类型?
这是我的查询的初始起点:
SELECT post_id, from, name, source, link, picture, updated_time, comments
FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me()
AND type='newsfeed') AND is_hidden = 0
I'm trying to submit a query for a specific type of status sent to a user's newsfeed, where type=video. I basically want all videos posted for a user, including those not hosted by FB (otherwise I would submit a videos query). I would like it if I could get FB to not return anything except videos, but I certainly don't see a solution for that. I don't see that the returned query even has a field that will contain this information, so that I can filter the returned info. Is there any field in the stream table that will tell me the type of post?
Here's my initial starting point for the query:
SELECT post_id, from, name, source, link, picture, updated_time, comments
FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me()
AND type='newsfeed') AND is_hidden = 0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设置流的类型(请参阅ref),但是视频( type = 128)将仅返回上传的视频。
这与使用图形 api 相矛盾(例如 js sdk:
FB.api('/me/home', function(response) {} )
),其中type: 'video'
被赋予附加视频链接(例如 YouTube)。但是,attachment.media[0] 字段将视频链接标识为
type: video
;但这是一个数组(我不知道如何在其中查询),所以我检查了该链接是否包含对 youtube 的引用(youtube 链接可以是长格式或缩写形式,youtu.be )You can set a type for the stream (see ref), but video (type = 128) will return only uploaded videos.
This is in contradiction to using the graph api (e.g. js sdk:
FB.api('/me/home', function(response) {} )
), wheretype: 'video'
is given to attached video links (e.g. YouTube)However, the attachment.media[0] field, identifies video links as being
type: video
; but that is an array (and I didn't know how to query in them) so I checked if the link contained a reference to youtube (youtube links can be long-form or shortened, youtu.be)