10

Given the URL of a public Facebook post, how can one find the post object in the FB Graph API? (secondarily, why are so many user feeds empty or nearly empty when accessed through the API?)

We would like to be able to comment on or like a post via the v2.x Graph API, given the post's URL. Doing so requires the post's object ID, which we can make some educated guesses about, but accessing the actual object through the API has proven unreliable (works for some posts but not others).

v2 of the API introduced app-scoped user IDs, and post IDs generally seem to be of the form {app-scoped user id}_{unique post id}. Here are the details of some attempts to find posts in the API with various combinations of these IDs (global user id, app-scoped user id, and post id).

OK let's try the other direction. We'll page through the user's feed until we find the post in question. It feels like this is more the expected use case for the API...

For reference, here is the GitHub issue where we have been tracking this problem.

4

2 回答 2

3

基本上你需要read_stream这个(你的应用程序不会被授予)。是的,即使帖子是公开的,您仍然需要read_stream能够读取各种帖子。

您可以在 Graph API Explorer 中轻松地使用它。首先,授予您的应用read_stream获取 Feed 中项目 ID 的权限——这将为您提供“表单应用范围的用户 ID 下划线帖子 ID”的 ID。然后删除read_stream(通过再次单击“获取访问令牌”并使用“清除”按钮),并尝试几个user_*权限 - 您会看到对于您的大多数帖子,即使是公开的帖子,您仍然只会得到“不支持”获取请求”,这只是意味着您不允许读取该对象。

Fe,我有一个公开帖子,其中分享了我时间轴上另一个页面的视频帖子,即typeisvideostatus_typeis shared_story,但既不允许user_statususer_videos不允许我阅读这篇文章 - 只有当我read_stream再次授权时,我的应用程序才能阅读该帖子。与另一篇 typestatus和 status_type的公共帖子相同mobile_status_update——使用 阅读read_stream,而不是任何user_*权限。

简而言之:使用 API v2 和read_stream仅授予不存在官方 FB 客户端的平台上的应用程序的限制不再可能实现您想要实现的目标。

于 2015-02-14T13:25:30.690 回答
0

一个建议是调用 api 来编写 Facebook 帖子,因为这些帖子返回您可以使用的有效 post_id

其次,当您尝试https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&path=525575504%2Fposts&version=v2.0&

你可以看到他的帖子 ID 不是public id以你写的 525575504_* 开头的

但他们仍然提出不受支持的获取请求

https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&path=10152853212485505_351575675029953&version=v2.0

第三,由于上述不起作用,这些帖子肯定是公开的吗?

于 2015-02-14T00:10:07.923 回答