我正在开发一个fb应用程序,在其中我想给用户时间表,但我需要排除“用户喜欢照片”,“在朋友的照片上留言”之类的故事.如何过滤和排除这些类型的故事
解决方法:
您可以通过查找story或story_tags键的存在来过滤这些Posts,因为它们不在用户发表的帖子中.
引用documentation故事关键的描述
Text of stories not intentionally generated by users, such as those generated when two users become friends; you must have the “Include recent activity stories” migration enabled in your app to retrieve these stories
或者您可以像这样尝试FQL的stream
select message from stream where source_id=me() and type in (46,56,80,56,128,247)
and filter_key in (select filter_key from stream_filter where uid=me())
这可能有助于您将帖子减少到所需的位置.
更新资料
您可能不需要使用经林果皞验证的类型字段来减少结果,因此查询可简化为
select message from stream where source_id=me() AND filter_key in
(select filter_key from stream_filter where uid=me())