Facebook graph api-如何获取用户提要,而没有用户关于喜欢和评论的帖子?

时间:2022-11-29
本文介绍了Facebook graph api-如何获取用户提要,而没有用户关于喜欢和评论的帖子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在开发一个 fb 应用程序,我想在其中为用户提供时间线,但我需要排除诸如用户喜欢照片"、朋友照片上的评论"之类的故事.我如何过滤和排除这些类型的故事

i am developing a fb app,in which i want to give the users time line,but i need to exclude stories like "User likes a photo","coments on friends's photo".how i filter and exclude these types of stories

推荐答案

你可以过滤这些 Posts 通过查找 storystory_tags 键的存在,因为这些在用户发布的帖子中不存在.

You can filter these Posts by looking for the presence of the story or story_tags key as these is not present in the Posts made by the User.

引用文档中story的描述代码>键

非用户故意生成的故事文本,例如两个用户成为朋友时生成的故事;您必须在您的应用中启用包括最近的活动故事"迁移才能检索这些故事

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

Or you may try FQL's stream like this

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())

这可能会帮助您将帖子减少到您想要的帖子.

which might help you to reduce the Posts to one that you desire.

更新

您可能不需要使用林果皞验证的 type 字段来减少结果,因此查询减少到

You might not require to reduce the result using type field as verified by 林果皞 , so the query reduces to

select message from stream where source_id=me() AND filter_key in
(select filter_key from stream_filter where uid=me())

这篇关于Facebook graph api-如何获取用户提要,而没有用户关于喜欢和评论的帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!