使用 FB 的 API 通过我的 Facebook 应用程序获取墙贴

发布于 2024-12-04 18:50:38 字数 310 浏览 0 评论 0原文

我制作了一个 Facebook 应用程序,人们用它来分享从我的网页到他们的墙的链接,现在我需要取回一段时间内(例如从 9 月 4 日到 9 月 10 日)通过它发布的帖子列表,包括他们的帖子 ID。

我知道我可以在信息发布时保存该信息,但我需要一些我没有以这种方式保存的旧数据。

我尝试过使用 FQL,但这需要指示 source_id(帖子所在的用户墙的 Facebook ID),但我无法知道。

我的应用程序的 Graph API 对象似乎也没有帮助,因为它没有与通过它发布的帖子的连接。

任何帮助都会非常感激,即使只是一个正确方向的标志。

I made a Facebook Application that people use to share links from my webpage to their walls, and now I need to get back a list of the posts made through it during a pediod of time (e.g. from Sep. 4th to Sep. 10th), incluiding their Post IDs.

I am aware that I could save that information at the moment of its publication, but I need some old data that I didn't save that way.

I have tried using FQL, but that requieres to indicate the source_id (Facebook ID of the user's wall where the post is on), which I am not able to know.

The Graph API object for my application doesn't seem to help either, since it doesn't have a connection for the posts made through it.

Any help would be really apreciated, even just a sign in the right direction.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我家小可爱 2024-12-11 18:50:38

按照建议,提示用户提供 read_stream 权限,然后我建议采用 fql 路线:

 SELECT post_id, actor_id, target_id, message 
 FROM stream 
 WHERE attribution=[your app name] 
       AND created_time > [since]
       AND created_time < [until] 
       AND filter_key in (SELECT filter_key 
                          FROM stream_filter 
                          WHERE uid=me() AND type='newsfeed')

这不太可能成为问题,但请注意返回的项目数量有限制,因此,如果您的时间跨度很宽并且您的用户发布了很多内容,您可能需要多使用 [until][since] 并进行多次调用检索所有内容。

另请参阅文档,了解有关您可以查询的字段的更多信息:http:// Developers.facebook.com/docs/reference/fql/stream/

As suggested, prompt the user for read_stream permissions, and then I'd suggest to take the fql route:

 SELECT post_id, actor_id, target_id, message 
 FROM stream 
 WHERE attribution=[your app name] 
       AND created_time > [since]
       AND created_time < [until] 
       AND filter_key in (SELECT filter_key 
                          FROM stream_filter 
                          WHERE uid=me() AND type='newsfeed')

It's not likely to be an issue, but be aware that there's a limit in the number of items returned, so if your time span is wide and your users posted a lot, you may have to play with the [until] and [since] a bit more and make several calls to retrieve everything.

Also take a look at the documentation for more information about fields you can query: http://developers.facebook.com/docs/reference/fql/stream/

鹿港巷口少年归 2024-12-11 18:50:38

提示用户提供 read_stream 权限,然后查询 /me/statuses 并查找应用程序中的更新。

Prompt the user for read_stream permissions and then query /me/statuses and look for updates from your application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文