2

是否可以根据其 id 获取 facebook 位置的纬度和经度?当我为我的 fb 帐户获取用户对象时,在 JSON 中很清楚

["location":{"id":"106423786059675","name":"Buenos Aires, Argentina"}].

好吧,如果我可以查询位置 id 106423786059675 的纬度和经度,那就太好了。

4

2 回答 2

1

您是否尝试检查 API 以获取该页面的详细信息?

http://graph.facebook.com/106423786059675

即使不需要访问令牌,也会返回大量信息,包括:

“位置”:{ “纬度”:-34.6033,“经度”:-58.3817 },

于 2012-05-12T02:38:34.510 回答
0

如果你使用 php,你可以这样做:

$fb_location_id = 'LOCATION_ID';
$jsonurl        = 'http://graph.facebook.com/'.$fb_location_id;
$json           = file_get_contents($jsonurl,0,null,null);
$json_output    = json_decode($json);
// the latitude
$fb_latitude    = $json_output->location->latitude;
// the longitude
$fb_longitude   = $json_output->location->longitude;
于 2015-02-09T20:14:36.940 回答