Facebook 图形 API,访问照片和帖子中的位置标签

发布于 2024-12-16 17:10:31 字数 3927 浏览 0 评论 0原文

在照片和帖子中,我经常看到位置标签指向代表某个地点的 Facebook 页面。它们通常以“near”、“at”或“in”开头。有人知道通过图形 API 或任何其他方式访问这些数据的方法吗?

这是一个例子: 网页,我将照片公开,以便每个人都可以看到 http://www.facebook.com/photo.php?pid=11671735&id=506482094" rel="nofollow">http://www.facebook.com/photo.php facebook.com/photo.php?pid=11671735&id=506482094 api调用 https://graph.facebook.com/10150601497547095?access_token=*

{
   "id": "10150601497547095",
   "from": {
      "name": "Edouard Tabet",
      "id": "506482094"
   },
   "name": "Alcohol grows on trees in Isabela, Galapagos",
   "picture": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg",
   "source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg",
   "height": 720,
   "width": 479,
   "images": [
      {
         "height": 2048,
         "width": 1365,
         "source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/329294_10150601497547095_506482094_11671735_110244218_o.jpg"
      },
      {
         "height": 720,
         "width": 479,
         "source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg"
      },
      {
         "height": 270,
         "width": 180,
         "source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_a.jpg"
      },
      {
         "height": 130,
         "width": 86,
         "source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg"
      },
      {
         "height": 112,
         "width": 75,
         "source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_t.jpg"
      }
   ],
   "link": "http://www.facebook.com/photo.php?pid=11671735&id=506482094",
   "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
   "created_time": "2012-01-16T23:34:54+0000",
   "position": 1,
   "updated_time": "2012-01-21T02:16:55+0000",
   "comments": {
      "data": [
         {
            "id": "10150601497547095_7207114",
            "from": {
               "name": "Tom LeNoble",
               "id": "218686"
            },
            "message": "hope you are having fun!",
            "can_remove": true,
            "created_time": "2012-01-16T23:36:33+0000"
         },
         {
            "id": "10150601497547095_7207963",
            "from": {
               "name": "Sol McKinney",
               "id": "1021642751"
            },
            "message": "How come Darwin didn't write about that?!",
            "can_remove": true,
            "created_time": "2012-01-17T01:31:39+0000"
         },
         {
            "id": "10150601497547095_7212820",
            "from": {
               "name": "Romain BL",
               "id": "556337447"
            },
            "message": "Des bisous mr Tabet! J'esp\u00e8re que tu vas bien depuis tout ce temps!",
            "can_remove": true,
            "created_time": "2012-01-17T18:19:13+0000"
         }
      ],
      "paging": {
         "next": "https://graph.facebook.com/10150601497547095/comments?access_token="
      }
   },
   "likes": {
      "data": [
         {
            "id": "1404245",
            "name": "Hannah Russin"
         },
         {
            "id": "1278210658",
            "name": "Seth Long"
         },
         {
            "id": "218686",
            "name": "Tom LeNoble"
         }
      ],
      "paging": {
         "next": "https://graph.facebook.com/10150601497547095/likes?access_token=&limit=25&offset=25&__after_id=218686"
      }
   }
}

On photos and posts I often see location tags pointing to a Facebook page representing a place. They are typically prepended by "near" , "at" or "in". Does anybody know of a way to access this data via the graph API or any other way?

Here is an example :
webpage, I made the photo public so everyone can see http://www.facebook.com/photo.php?pid=11671735&id=506482094
api call https://graph.facebook.com/10150601497547095?access_token=*

{
   "id": "10150601497547095",
   "from": {
      "name": "Edouard Tabet",
      "id": "506482094"
   },
   "name": "Alcohol grows on trees in Isabela, Galapagos",
   "picture": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg",
   "source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg",
   "height": 720,
   "width": 479,
   "images": [
      {
         "height": 2048,
         "width": 1365,
         "source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/329294_10150601497547095_506482094_11671735_110244218_o.jpg"
      },
      {
         "height": 720,
         "width": 479,
         "source": "http://a1.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/381095_10150601497547095_506482094_11671735_110244218_n.jpg"
      },
      {
         "height": 270,
         "width": 180,
         "source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_a.jpg"
      },
      {
         "height": 130,
         "width": 86,
         "source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_s.jpg"
      },
      {
         "height": 112,
         "width": 75,
         "source": "http://photos-a.ak.fbcdn.net/hphotos-ak-snc7/381095_10150601497547095_506482094_11671735_110244218_t.jpg"
      }
   ],
   "link": "http://www.facebook.com/photo.php?pid=11671735&id=506482094",
   "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
   "created_time": "2012-01-16T23:34:54+0000",
   "position": 1,
   "updated_time": "2012-01-21T02:16:55+0000",
   "comments": {
      "data": [
         {
            "id": "10150601497547095_7207114",
            "from": {
               "name": "Tom LeNoble",
               "id": "218686"
            },
            "message": "hope you are having fun!",
            "can_remove": true,
            "created_time": "2012-01-16T23:36:33+0000"
         },
         {
            "id": "10150601497547095_7207963",
            "from": {
               "name": "Sol McKinney",
               "id": "1021642751"
            },
            "message": "How come Darwin didn't write about that?!",
            "can_remove": true,
            "created_time": "2012-01-17T01:31:39+0000"
         },
         {
            "id": "10150601497547095_7212820",
            "from": {
               "name": "Romain BL",
               "id": "556337447"
            },
            "message": "Des bisous mr Tabet! J'esp\u00e8re que tu vas bien depuis tout ce temps!",
            "can_remove": true,
            "created_time": "2012-01-17T18:19:13+0000"
         }
      ],
      "paging": {
         "next": "https://graph.facebook.com/10150601497547095/comments?access_token="
      }
   },
   "likes": {
      "data": [
         {
            "id": "1404245",
            "name": "Hannah Russin"
         },
         {
            "id": "1278210658",
            "name": "Seth Long"
         },
         {
            "id": "218686",
            "name": "Tom LeNoble"
         }
      ],
      "paging": {
         "next": "https://graph.facebook.com/10150601497547095/likes?access_token=&limit=25&offset=25&__after_id=218686"
      }
   }
}

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

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

发布评论

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

评论(2

浮光之海 2024-12-23 17:10:31

我想通了...当使用“照片 id”访问照片时,地点属性不会出现在结果中...当通过“帖子 id”访问同一张照片时,地点属性会出现在 JSON 结果中GRAPH API 调用。不是很方便...

I figured it out... When accessing a photo with the "photo id" the place attribute is not present in the result... when accessing the same photo through its "post id" then the place attribute appears in the JSON result of the GRAPH API call. Not very convenient...

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