問題描述
我正在開發(fā)一個(gè) fb 應(yīng)用程序,我想在其中為用戶提供時(shí)間線,但我需要排除諸如用戶喜歡照片"、朋友照片上的評(píng)論"之類的故事.我如何過濾和排除這些類型的故事
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 通過查找 story
或 story_tags
鍵的存在,因?yàn)檫@些在用戶發(fā)布的帖子中不存在.
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的描述代碼>鍵
非用戶故意生成的故事文本,例如兩個(gè)用戶成為朋友時(shí)生成的故事;您必須在您的應(yīng)用中啟用包括最近的活動(dòng)故事"遷移才能檢索這些故事
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())
這可能會(huì)幫助您將帖子減少到您想要的帖子.
which might help you to reduce the Posts to one that you desire.
更新
您可能不需要使用林果皞驗(yàn)證的 type
字段來減少結(jié)果,因此查詢減少到
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())
這篇關(guān)于Facebook graph api-如何獲取用戶提要,而沒有用戶關(guān)于喜歡和評(píng)論的帖子?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!