Facebook FQL。在按日期/时间排序的单个查询中获取所有页面更改的最简单方法是什么?

发布于 2024-12-12 08:21:49 字数 992 浏览 0 评论 0原文

我需要监视一个页面和所有相关活动。这是我想要实现的结果:

29/10 - User: John - Action: Like    - Object type: status - Object id: 123456
29/10 - User: Mary - Action: Comment - Object type: status - Object id: 123343
29/10 - User: Etan - Action: Tagged  - Object type: status - Object id: 123537
29/10 - User: Arth - Action: Like    - Object type: status - Object id: 123876
29/10 - User: Jack - Action: Post    - Object type: status - Object id: 123423
29/10 - User: Jack - Action: Photo   - Object type: photo - Object id: 123423

您可以以按术语搜索为例,它提供了预期的一切。我们在一次通话中订购了自指定日期/时间以来的评论、帖子、状态和照片:

https://graph.facebook.com/search?q=watermelon&type=post

既然没有办法像 /search?q= 那样简单,怎么办我用 FQL 来做吗?

我应该使用 stream 表吗?在这种情况下,我应该应用 stream_table 的哪个过滤器?

有没有一种简单的方法可以做到这一点,或者我是否必须在单独的查询中获取所有内容?

(如果有帮助:我正在使用 Facebook PHP SDK)

I need to monitor one single page and all related activities. This is the result I'm trying to accomplish:

29/10 - User: John - Action: Like    - Object type: status - Object id: 123456
29/10 - User: Mary - Action: Comment - Object type: status - Object id: 123343
29/10 - User: Etan - Action: Tagged  - Object type: status - Object id: 123537
29/10 - User: Arth - Action: Like    - Object type: status - Object id: 123876
29/10 - User: Jack - Action: Post    - Object type: status - Object id: 123423
29/10 - User: Jack - Action: Photo   - Object type: photo - Object id: 123423

You can take as example the search by term, that provide everything as expected. We have in one single call comments, posts, statuses and photos ordered since the specified date/time:

https://graph.facebook.com/search?q=watermelon&type=post

Since there's no way to do it simple as the /search?q=, how can I do it with FQL?

Should I use the stream table? In that case, which filter of the stream_table should I apply?

Is there an easy way to do that or do I have to get every thing in separated queries?

(If it helps: I'm using Facebook PHP SDK)

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

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

发布评论

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

评论(2

jJeQQOZ5 2024-12-19 08:21:49

我们也在使用这种技术,但仍然存在一个问题。即使您指定了 ORDER BY Updated_time DESC,流表也会返回 Feed 的热门帖子视图,而不是最新视图。

所以你可能会错过帖子,尤其是粉丝的帖子。
我们还没有找到解决这个问题的方法......

We are also using this technique but there is still an issue. The stream table returns the Top Posts view of the feed and not the Most recent one EVEN if you specify an ORDER BY updated_time DESC.

So you might miss posts, especially posts from fans.
We have not found a solution to this problem...

暖伴 2024-12-19 08:21:49

我最近遇到了同样的问题。最初我认为页面的 feed 连接就是我所需要的,但事实证明,如果您使用 sinceuntil 进行排序将查看帖子的 created_at 属性。这意味着对旧帖子的评论不会显示。

我能找到的最佳解决方案是首先在 stream 表上执行 FQL 查询以获取帖子 ID:

SELECT post_id FROM stream WHERE source_id = {PAGE_ID} AND updated_time > {TIME}

然后一次获取所有帖子:

https://graph.facebook.com?ids=ID1,ID2,ID3...

I ran into the same problem recently. Initially I thought that the feed connection of a page will be what I need, but it turns out that if you sort with since or until it will look at a post's created_at attribute. This means that comments on older posts won't show up.

The best solution I could find is to first do a FQL query on the stream table to get the post ids:

SELECT post_id FROM stream WHERE source_id = {PAGE_ID} AND updated_time > {TIME}

and then simply get all the posts at once:

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