使用 graph-api/fql,如何获取引起通知的帖子/评论?

发布于 2024-10-17 12:53:24 字数 149 浏览 7 评论 0原文

我可以使用 FQL 遍历通知列表。伟大的。现在,我如何弄清楚如何获取通知适用的帖子/评论?

例子: 通知是:“UserX 对您的帖子发表了评论!”

从返回的 fql 表中,如何找到所述评论的 post_id 或 xid,以便我可以找到该帖子和评论列表?

I can traverse the list of notifications by using FQL. Great. Now, how do I figure out how to get the post/comment to which the notification applies?

Example:
The notification is: "UserX commented on your post!"

From the fql table returned, how do I find the post_id or the xid for said comment so that I can find the post and the list of comments?

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

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

发布评论

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

评论(1

嗼ふ静 2024-10-24 12:53:24

您可以调用 REST API notification.getList - https://developers.facebook。 com/docs/reference/rest/notifications.getList/

除了基本权限外,您不需要任何权限。

这将返回数据,包括 object_id 和 object_type。

如果 object_type 是“stream”,您可以通过 notification.getList 查询将 post_id 字段设置为 object_id 来查询流表。您可以从流表中获取评论。

notification.getList 响应的示例片段:

<notifications list="true">
  <notification>
    .
    .
    <object_id>12345678_1001251985851</object_id>
    <object_type>stream</object_type>
    <icon_url>http://static.ak.fbcdn.net/rsrc.php/v1/yr/r/B4fl7q9VLz5.gif</icon_url>
 </notification>

您的后续查询:

SELECT comments FROM stream WHERE post_id='12345678_1001251985851'

You can call the REST API notifications.getList - https://developers.facebook.com/docs/reference/rest/notifications.getList/

You do not need any permissions beyond the basic.

This will return data including, object_id and object_type.

If object_type is "stream" you can query the stream table with the post_id field set to the object_id from the notifications.getList query. You can get the comments from the stream table.

Example snippet of notifications.getList response:

<notifications list="true">
  <notification>
    .
    .
    <object_id>12345678_1001251985851</object_id>
    <object_type>stream</object_type>
    <icon_url>http://static.ak.fbcdn.net/rsrc.php/v1/yr/r/B4fl7q9VLz5.gif</icon_url>
 </notification>

Your follow-on query:

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