JS 新浪API获取IP归属地

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js

返回值数据格式:var remote_ip_info = {“ret”:1,”start”:”59.37.164.179″,”end”:”59.37.165.17″,”country”:”\u4e2d\u56fd”,”province”:”\u5e7f\u4e1c”,”city”:”\u6c5f\u95e8″,”district”:””,”isp”:”\u7535\u4fe1″,”type”:””,”desc”:””};

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=61.135.169.125

返回值数据格式:var remote_ip_info = {“ret”:1,”start”:”61.135.164.0″,”end”:”61.135.169.125″,”country”:”\u4e2d\u56fd”,”province”:”\u5317\u4eac”,”city”:”\u5317\u4eac”,”district”:””,”isp”:”\u8054\u901a”,”type”:””,”desc”:””};

JSON格式:
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json

返回的为utf-8编码,直接输出就可以了

上一篇:java方法可变参数的写法


下一篇:Linux 查看系统硬件信息汇总 (部份实例详解Centoso为例)