从某个位置检索Facebook帖子

时间:2016-04-26 07:06:14

标签: facebook api facebook-graph-api

我想检索链接到某个位置的所有帖子。所以我知道如何检索位置(https://graph.facebook.com/search?q=&type=place&center=37.76,-122.427&distance=1000&access_token=XXXXXXXX|XXXXXXXXXXX

这将返回如下位置:

{   "data": [
  {
     "category": "Local business",
     "category_list": [
        {
           "id": "209889829023118",
           "name": "Landmark"
        },
        {
           "id": "115090141929327",
           "name": "Park"
        }
     ],
     "location": {
        "street": "",
        "city": "San Francisco",
        "state": "CA",
        "country": "United States",
        "zip": "94114",
        "latitude": 37.759791,
        "longitude": -122.427027
     },
     "name": "Dolores Park",
     "id": "557140290973390"
  },
  {
     "category": "Local business",
     "category_list": [
        {
           "id": "152142351517013",
           "name": "Corporate Office"
        }
     ],
     "location": {
        "street": "88 Cumberland St, Apt 1A",
        "city": "San Francisco",
        "state": "CA",
        "country": "United States",
        "zip": "94110-1584",
        "latitude": 37.75923,
        "longitude": -122.42543
     },
     "name": "Terrarium Kits Corporate Headquarters",
     "id": "593264107360497"
  },
  {
     "category": "Local business",
     "category_list": [
        {
           "id": "115090141929327",
           "name": "Park"
        }
     ],

但我不想要这些地点,我想要检索链接到这些地点的所有公开帖子。有谁知道我怎么能得到那些?

谢谢!

1 个答案:

答案 0 :(得分:-1)

您需要使用Facebook图表搜索功能,将'type'设置为'place',将'center'设置为包含纬度/经度值。例如:https://graph.facebook.com/search?type=place&center=37.76,-122.427&distance=1000&access_token=insert访问令牌

获得ID后,您可以使用它通过Graph API获取更多信息(例如页面网址)。例如:http://graph.facebook.com/105687759464007402290636575506?fields=location,link,category,category_list,emails,website,name,name_with_location_descriptor