调用新浪接口获得访问者地理位置及线路情况
2013-05-15 16:01
232 查看
新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js
新浪多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=218.192.3.42
搜狐IP地址查询接口(默认GBK):http://pv.sohu.com/cityjson
搜狐IP地址查询接口(可设置编码):http://pv.sohu.com/cityjson?ie=utf-8
搜狐另外的IP地址查询接口:http://txt.go.sohu.com/ip/soip
腾讯的接口:http://fw.qq.com/ipaddress (腾讯的接口原本是最好用的,可现在打不开啦)
直接访问新浪接口的php文件会返回如下内容:
var remote_ip_info = {"ret":1,"start":"58.58.32.0","end":"58.58.47.255","country":"\u4e2d\u56fd","province":"\u5c71\u4e1c","city":"\u9752\u5c9b","district":"","isp":"\u7535\u4fe1","type":"","desc":""};
这是这是encode后的json串,decode后内容:
{
"ret":1,
"start":"58.58.32.0",
"end":"58.58.47.255",
"country":"中国",
"province":"山东",
"city":"青岛",
"district":"",
"isp":"电信",
"type":"",
"desc":""
}
新浪js接口使用举例:
<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" charset="gb2312"></script>
<script type="text/javascript">
var ss = remote_ip_info['country'] + remote_ip_info['province']+ remote_ip_info['city'];
alert(ss)
</script>
参考原文:http://blog.sina.com.cn/s/blog_69d6a78101011ksf.html
新浪多地域测试方法:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=218.192.3.42
搜狐IP地址查询接口(默认GBK):http://pv.sohu.com/cityjson
搜狐IP地址查询接口(可设置编码):http://pv.sohu.com/cityjson?ie=utf-8
搜狐另外的IP地址查询接口:http://txt.go.sohu.com/ip/soip
腾讯的接口:http://fw.qq.com/ipaddress (腾讯的接口原本是最好用的,可现在打不开啦)
直接访问新浪接口的php文件会返回如下内容:
var remote_ip_info = {"ret":1,"start":"58.58.32.0","end":"58.58.47.255","country":"\u4e2d\u56fd","province":"\u5c71\u4e1c","city":"\u9752\u5c9b","district":"","isp":"\u7535\u4fe1","type":"","desc":""};
这是这是encode后的json串,decode后内容:
{
"ret":1,
"start":"58.58.32.0",
"end":"58.58.47.255",
"country":"中国",
"province":"山东",
"city":"青岛",
"district":"",
"isp":"电信",
"type":"",
"desc":""
}
新浪js接口使用举例:
<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" charset="gb2312"></script>
<script type="text/javascript">
var ss = remote_ip_info['country'] + remote_ip_info['province']+ remote_ip_info['city'];
alert(ss)
</script>
参考原文:http://blog.sina.com.cn/s/blog_69d6a78101011ksf.html
相关文章推荐
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- 腾讯新浪通过IP地址获取当前地理位置(省份)的接口
- 获取用户真实 IP , 淘宝IP接口获得ip地理位置
- Javascript通过腾讯,新浪,谷歌 IP接口获取地理位置信息
- 腾讯新浪通过IP地址获取当前地理位置(省份)的接口
- php利用新浪接口查询ip获取地理位置示例
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置(转)
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- 使用PHP+淘宝IP地址库接口获得IP所属地理位置
- 利用google提供的API(JavaScript接口)获取网站访问者IP地理位置的代码详解
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- 企业号如何调用JS接口(以调用地理位置接口为例)
- 调用高德的接口,地理位置和经纬度相互转换
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- PHP获取用户真实 IP , 淘宝IP接口获得ip地理位置
- 腾讯与新浪的通过IP地址获取当前地理位置(省份)的接口
- 腾讯与新浪的通过IP地址获取当前地理位置(省份)的接口
- php利用新浪接口查询ip获取地理位置示例