dco*_*bus 2 php google-maps geocoding geolocation
据我所知,谷歌每天要求2,500个请求...但是EARTH没有办法让我今天提出这么多请求,而且我只是继续获得'OVER_QUERY_LIMIT'
$street_no = get_post_meta($prop->ID, 'street_no', true);
$street = get_post_meta($prop->ID, 'street', true);
$street_suffix = get_post_meta($prop->ID, 'street_suffix', true);
$addr = urlencode( $street_no." ".$street." ".$street_suffix." BC Canada" );
$url = 'http://maps.googleapis.com/maps/api/geocode/json?address='.$addr.'&sensor=true';
$json_result = json_decode(file_get_contents($url));
if ( $json_result->status === "OVER_QUERY_LIMIT" ) :
sleep(2);
$json_result = json_decode(file_get_contents($url));
endif;
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,如果我得到状态OVER_QUERY_LIMIT我告诉脚本睡2秒然后继续...这似乎在今天早上的某个时候工作,但现在我甚至不能得到一个地址编码.
我在这一点上不知道该做什么......这使我的应用程序完全没用.
| 归档时间: |
|
| 查看次数: |
12496 次 |
| 最近记录: |