大家好,
我找到了一个替代解决方案
请使用此图 api
https://graph.facebook.com/v2.3/me/tagged_places?access_token=$access_token
$json_locations
=file_get_contents("https://graph.facebook.com/v2.3/me/tagged_places?access_token=$access_token");
$locations = json_decode($json_locations, TRUE);
foreach($locations['data'] as $key => $jsons) {
if(!isset($jsons['status'])) { $jsons['status']='-'; }
if(!isset($jsons['place']['id'])) { $jsons['place']['id']='-'; }
if(!isset($jsons['place']['name'])) { $jsons['place']['name']='-';
} if(!isset($jsons['place']['location']['city'])) {
$jsons['place']['location']['city']='-'; }
if(!isset($jsons['place']['location']['country'])) {
$jsons['place']['location']['country']='-'; }
if(!isset($jsons['place']['location']['latitude'])) {
$jsons['place']['location']['latitude']='-'; }
if(!isset($jsons['place']['location']['longitude'])) {
$jsons['place']['location']['longitude']='-'; } $type='签到';
$checkin_id=mysql_real_escape_string($jsons['place']['id']);
$name=mysql_real_escape_string($jsons['place']['name']);
$city=mysql_real_escape_string($jsons['place']['location']['city']);
$country=mysql_real_escape_string($jsons['place']['location']['country']);
$latitude=mysql_real_escape_string($jsons['place']['location']['latitude']);
$longitude=mysql_real_escape_string($jsons['place']['location']['longitude']); //echo "更新设置用户注册
纬度='$latitude',经度='$longitude'
face_book_id='$id'"; if($type=='checkin' || $type=='status') {
$check=mysql_query("select * from fb_checkins where
facebook_id='$facebook_id' and type='$type' and name='$name' and
checkin_id='$checkin_id'") 或死(mysql_error());
if(mysql_num_rows($check)>0) { $fetch1=mysql_fetch_assoc($check);
$id=$fetch1['id']; $delete=mysql_query("从 fb_checkins 中删除
where id='$id'"); $sql=mysql_query("插入到 fb_checkins 集合中
facebook_id='$facebook_id',name='$name',checkin_id='$checkin_id',type='$type',city='$city',country='$country',latitude='$latitude',longitude ='$经度'")
或死(mysql_error());
} else { $sql=mysql_query("插入 fb_checkins 集合
facebook_id='$facebook_id',name='$name',checkin_id='$checkin_id',type='$type',city='$city',country='$country',latitude='$latitude',longitude ='$经度'")
或死(mysql_error()); } } }
- 列表项