是否有 API 可以检索 Facebook 最近的活动?

发布于 2024-11-23 20:59:24 字数 332 浏览 0 评论 0原文

我知道有一个 Graph api url 用于获取最近的墙源:

https://graph.facebook.com/me/feed?access_token=...

但是如何获取最近的活动?有什么办法吗? FQL(不是图形 API)也可以工作。我真的不在乎我以哪种方式得到它。

我正在尝试获取最近的活动,它显示为墙的一部分。它具有与标准墙条目相同的 ID,但它们不会在 /me/feed 请求中返回,因为它们在 facebook 上的处理方式不同,我正在尝试找出一个简单的方法获取它们的方法就像 /me/feed

I know there's a Graph api url for getting the recent wall feeds:

https://graph.facebook.com/me/feed?access_token=...

But how do I get the Recent Activity? Is there any way? FQL (not Graph API) can work too. I don't really care which way I get it.

I'm trying to get the RECENT ACTIVITY, which appears as part of the wall. It has same IDs like the standard wall entries have, but they aren't returned in the /me/feed request, because they are treated differently on facebook, and I'm trying to find out a simple way to get them just like /me/feed

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

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

发布评论

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

评论(5

喵星人汪星人 2024-11-30 20:59:24

没有单个社交插件或单个 API端点可以准确提供您所描述的内容,但您可以做的是订阅实时更新,请在此处查看相关文档:

https://developers.facebook.com/docs/reference/api/realtime/

使用此界面当用户的朋友发生变化时,您可以订阅更新,例如通过发送 POST 请求到:

graph.facebook.com/[app-id]/subscriptions?access_token=...&object=user&fields=user$callback_url=...

正如文档所述,并非所有内容都可用通过实时更新,但希望这能让您非常接近您正在寻找的功能。

There isn't a single social plugin or a single API endpoint that provides exactly what you are describing, but what you can do is subscribe to Real-time Updates, check out the docs on it here:

https://developers.facebook.com/docs/reference/api/realtime/

Using this interface you could subscribe to updates for when a user's friends change for example by sending a POST request to:

graph.facebook.com/[app-id]/subscriptions?access_token=...&object=user&fields=user$callback_url=...

As the documentations notes, not everything is available via Real-time Updates, but hopefully this gets you pretty close to the functionality that you are looking for.

留蓝 2024-11-30 20:59:24

您是否正在寻找类似于 Facebook 本身在“通知”中显示的内容此 FQL 查询应该可以解决问题。

FB.api( {
            method : 'fql.query',
    query : 'SELECT notification_id, sender_id, title_html, body_html, href FROM notification WHERE recipient_id=me()'
        }, function(response){console.log(response);});

可用字段列表位于此处

我喜欢使用 Chrome 控制台来探索 Facebook 返回的数据结构,即“console.log”调用。显然,您需要提供自己的回调...

请注意,从 10 月份开始,这将需要特殊权限(“manage_notifications”),如 此处概述

Are you looking for something like what Facebook itself displays in the "notifications" This FQL query should do the trick.

FB.api( {
            method : 'fql.query',
    query : 'SELECT notification_id, sender_id, title_html, body_html, href FROM notification WHERE recipient_id=me()'
        }, function(response){console.log(response);});

A list of available fields is here.

I like to use the Chrome console to explore the data structures that Facebook returns, thus the "console.log" call. Obviously you will need to provide your own callback...

Note that this will require a special permission ("manage_notifications") starting in October as outlined here.

趴在窗边数星星i 2024-11-30 20:59:24

您可以使用用户/家庭边缘。

此端点返回用户在其新闻源中看到的帖子。这
此 API 返回的帖子可能与某个人的帖子不同
将在 facebook.com 或 Facebook 的移动应用中看到。

https://developers.facebook.com/docs/graph -api/reference/v2.3/user/home

You can use the user/home edge.

This endpoint returns posts a person sees in their News Feed. The
posts returned by this API may not be identical to the posts a person
would see on facebook.com or in Facebook's mobile apps.

https://developers.facebook.com/docs/graph-api/reference/v2.3/user/home

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