如何检索“地点”? Facebook Graph Post 对象的字段?

发布于 2024-12-16 22:55:27 字数 1527 浏览 0 评论 0原文

我正在尝试从 Facebook 好友处检索 Facebook Graph Post 对象的“Place”字段。获得具有 friends_statusread_stream 权限的访问令牌后,我向 Graph API 发出请求,如下所示:

http://graph.facebook.com/[user_id ]_[post_id]

返回的是 中描述的一些字段Post 的 Graph API 文档

{
  "id": "1164358582_2458311174854", 
  "from": {
    "name": "Joe Blo", 
    "id": "1164358582"
  }, 
  "message": "Is pretty bummed today", 
  "actions": [
    {
      "name": "Comment", 
      "link": "http://www.facebook.com/1164358582/posts/2458311174854"
    }, 
    {
      "name": "Like", 
      "link": "http://www.facebook.com/1164358582/posts/2458311174854"
    }
  ], 
  "type": "status", 
  "application": {
    "name": "Facebook for Android", 
    "id": "350685531721"
  }, 
  "created_time": "2011-11-20T03:23:04+0000", 
  "updated_time": "2011-11-20T12:12:49+0000", 
  "comments": {
    "data": [
      {
        "id": "1164358582_2458311174852_2962531", 
        "from": {
          "name": "Sue Candy", 
          "id": "1056617421"
        }, 
        "message": "OMG I'm so sorry!!!", 
        "created_time": "2011-11-20T03:25:06+0000"
      }
    ], 
    "count": 1
  }
}

这个一切都很好,除了当我在我的 Facebook 信息流中看到这篇文章时,它还显示了该文章附带的位置:

9 小时前,靠近埃尔里诺,OK

我期望 El Reno,OK 将作为字段返回的对象放置在这篇文章中,但我没有看到它。

在 Facebook Graph API Explorer 中,我尝试启用几乎所有权限,但没有看到响应有任何差异(没有返回“地点”字段)。我对这个问题的看法是错误的吗?

I am trying to retrieve the "Place" field of a Facebook Graph Post object from a Facebook friend. After obtaining an access token with the friends_status and read_stream permissions, I request from the Graph API like so:

http://graph.facebook.com/[user_id]_[post_id]

What is returned are some of the fields described in the Graph API docs for Post:

{
  "id": "1164358582_2458311174854", 
  "from": {
    "name": "Joe Blo", 
    "id": "1164358582"
  }, 
  "message": "Is pretty bummed today", 
  "actions": [
    {
      "name": "Comment", 
      "link": "http://www.facebook.com/1164358582/posts/2458311174854"
    }, 
    {
      "name": "Like", 
      "link": "http://www.facebook.com/1164358582/posts/2458311174854"
    }
  ], 
  "type": "status", 
  "application": {
    "name": "Facebook for Android", 
    "id": "350685531721"
  }, 
  "created_time": "2011-11-20T03:23:04+0000", 
  "updated_time": "2011-11-20T12:12:49+0000", 
  "comments": {
    "data": [
      {
        "id": "1164358582_2458311174852_2962531", 
        "from": {
          "name": "Sue Candy", 
          "id": "1056617421"
        }, 
        "message": "OMG I'm so sorry!!!", 
        "created_time": "2011-11-20T03:25:06+0000"
      }
    ], 
    "count": 1
  }
}

This is all fine and dandy, except for the fact that when I see this Post within my Facebook stream, it also shows a location accompanying the post:

9 hours ago near El Reno, OK

I expected the El Reno, OK Place object returned as a field within this Post, but I don't see it.

In the Facebook Graph API Explorer, I've tried enabling almost every permission and I am not seeing any difference in the response (no "Place" field returned). Am I going about this incorrectly?

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

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

发布评论

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

评论(1

墟烟 2024-12-23 22:55:27

不是 100% 确定,但我认为你只能获取“地点”信息,如果它是“签到”类型。我完全明白你的意思,我自己也想知道。

https://developers.facebook.com/tools/

如果您还没有,请尝试使用 Graph API Explorer 工具已经看过了。

Not 100% sure but I think you can only get the "place" info if it is of type "checkin". I totally get where you are coming from, I wondered about that myself.

https://developers.facebook.com/tools/

Try the Graph API Explorer Tool if you haven't already looked at it.

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