Created
May 14, 2016 02:08
-
-
Save wvv8oo/64dcd5e59431f31633cfb02cce33a249 to your computer and use it in GitHub Desktop.
获取中国电信杭州的靓号列表
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var numbers = []; | |
var total = 0; | |
var isFind = false; | |
var checkNumber = function(number){ | |
if(/5800\s58/.test(number) && number.substr(-2) == number.substr(-1)){ | |
isFind = true; | |
alert('找到了' + number); | |
return true; | |
}else if(/5800/.test(number)){ | |
if(numbers.indexOf(number) < 0){ | |
numbers.push(number); | |
console.log(number); | |
} | |
} | |
return false; | |
}; | |
var load = function(){ | |
console.log('尝试试次:', total++); | |
$j.ajax({ | |
url : '/number/xuanhao/getDJLH.html', | |
method : 'POST', | |
data : {areaId : "571"}, | |
success : function(data){ | |
if(data == 'null'){ | |
console.log('null'); | |
}else if(data.indexOf('error|') == 0){ | |
console.log(data); | |
}else{ | |
var djlhArr = eval(data); | |
for(var i = 0; i < djlhArr.length; i ++){ | |
var number = djlhArr[i]['PHONE_NUMBER']; | |
if(!checkNumber(number)){ | |
} | |
} | |
} | |
if(!isFind){ | |
setTimeout(function(){ | |
load(); | |
}, 10000); | |
} | |
} | |
}); | |
} | |
load(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment