简体   繁体   English

如何在不使用FQL的情况下将Facebook Graph API限制为仅由用户发布(而不是评论或喜欢)?

[英]How to limit Facebook Graph API to only posts (not comments or likes) by user without using FQL?

I am trying to query the FB graph API for all of my posts. 我正在尝试查询FB graph API的所有帖子。 I would like the result set to only feature items that I've posted on my timeline. 我希望结果集仅包含我在时间轴上发布的项目。 Not other users, and not my likes or comments. 不是其他用户,也不是我的喜欢或评论。

The documentation is extremely confusing and most of the knowledge I've gained is through trial and error. 文档非常混乱,我所获得的大多数知识都是通过反复试验得出的。 To date, the only proposed solutions to this I've found online require the use of FQL (such as in this similar question: Facebook graph api- how to get user feed,with out posts about likes and comment by the user? ) however the FB documentation states that FQL is deprecated and will not be supported in the future so I would like to avoid it. 迄今为止,我在网上找到的唯一建议的解决方案需要使用FQL(例如,在类似的问题中: Facebook图形API-如何获取用户供稿,而没有用户的喜欢和评论的帖子? ) FB文档指出FQL已过时,以后将不再受支持,因此我想避免这种情况。 Additionally this is currently structured as a url request and if at all possible, I would like to keep it so. 另外,目前这是作为url请求构成的,如果可能的话,我希望保持不变。

To date, I've tried: 到目前为止,我已经尝试过:

/[userid]?fields=posts.limit(100).fields( picture, link, created_time, from, message, description, object_id )

which will get me all of my posts with the data fields I require, but it also includes "Likes" and when I "Comment" anywhere - which I don't want. 它将为我提供所有我需要的数据字段的帖子,但其中包括“喜欢”以及何时“评论”任何地方-我不需要。

 /[userid]?fields=feed.limit(100).fields( picture, link, created_time, from, message, description, object_id )

which returns only posts - but also includes posts made by others on my timeline (and I don't want those either). 它仅返回帖子-而且包括其他人在我的时间轴上发布的帖子(而且我也不想要这些帖子)。

It seems unclear to me if there is any more robust way to work with these different feed types as documented: 对于我来说,似乎尚不清楚是否有更强大的方法来处理这些记录的不同类型的提要:

https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/ https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/

Can anyone tell if there is a way to either limit the "feed" edge to only my posts (not including others posting to my timeline) or filter the "posts" edge to remove the "likes" and "comments"? 谁能说出是否有办法将“订阅源”边缘限制为仅我的帖子(不包括发布到我的时间轴上的其他帖子),或者过滤“帖子”边缘以删除“喜欢”和“评论”?

Instaead of /feed, you can use /posts. 在/ feed中,您可以使用/ posts。

More info here: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed 此处提供更多信息: https : //developers.facebook.com/docs/graph-api/reference/v2.0/user/feed

It's not possible as far as I know to generally apply filters to the Graph API calls, except very little exceptions. 据我所知,除了极少数例外,通常无法将过滤器应用于Graph API调用。

/user/feed is an example ( https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/#read ), where you can specify either with=location or filter={stream_filter} . /user/feed是一个示例( https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/#read ),您可以在其中指定with=locationfilter={stream_filter}

{stream_filter} in this case is a result of the filter_key field of the following FQL query: 在这种情况下,{stream_filter}是以下FQL查询的filter_key字段的结果:

select filter_key, name from stream_filter where uid=me()

Maybe you can try 也许你可以尝试

GET /me/feed?filter=app_2915120374

which should give you the status updates. 这应该为您提供状态更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Graph API获取每个粉丝的喜欢计数,Facebook页面上帖子的评论 - How to get count of each fan's likes, comments for posts on Facebook page using Graph API 如何使用Graph API或FQL重新获取Facebook个人资料图片评论 - How To Retrive Facebook Profile Picture Comments using Graph API or FQL 仅在Facebook所有公共帖子中搜索使用Graph API或FQL链接的帖子? - Searching Facebook all public posts only for posts with links using Graph API or FQL? 如何使用 Facebook Graph API 获取广告帖子的 Facebook 评论 - How to get facebook comments of ads posts using Facebook Graph API 查找“用户查看的帖子” facebook graph api FQL - Find 'posts viewed by user' facebook graph api FQL 如何使用Graph API使用户“喜欢” facebook中的页面? - How to make a user “likes” a page in facebook using Graph API? facebook api获得包含> 2条评论或> 4个赞的完整帖子 - facebook api getting full posts with > 2 comments or > 4 likes 使用Graph API和FQL从URL检索Facebook评论 - retrieve Facebook Comments from the URL using Graph API and FQL 无法使用Android中的Facebook graph API查找喜欢和评论计数 - not able to find likes and comments count using Facebook graph API in android 检查Facebook用户是否喜欢使用fql的页面 - Check if a Facebook user likes a page using fql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM