20220110,新浪的已经失效了,有兴趣可以自己去百度一下,提供接口的很多.
判断地区跳转代码,可以识别当前用户省份,市地区,然后跳转到指定的url上.

如:北京用户跳转到bj.html ,上海用户自动跳转到sh.html

黑帽技术常用手段之一,做黑帽的经常使用此方法劫持流量,下面的代码就是利用新浪api进行跳转,代码如下:请各位按自己需求进行修改

<script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" charset="GB2312" ></script>
<script type=text/javascript>
var _area=remote_ip_info.province;
if( _area=='北京'){
    window.location.href="/bj.html";
}else if( _area=='上海'){
    window.location.href="/sh.html";
}else{
    window.location.href="http://www.xxxx.com/";
}
</script>