Created
March 18, 2015 16:51
-
-
Save bydmm/9d37946385f3cc1ee6d3 to your computer and use it in GitHub Desktop.
request to ..
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 request = require('request'); | |
var j = request.jar(); | |
var cookie = request.cookie('cs=Robot/"%"3FEOQGVVASONNSNSYFZIBVFYRLROMNOOEXCJRFVIPI; TQQSMQHGYNRQSDTXJELM=XUDADZWMWFFQHNKGNWAQIMPDAYRIILZJQTPCLAOV'); | |
var url = 'http://www.apple-vese.com/Save3.asp'; | |
j.setCookie(cookie, url, function(error, cookie) {}); | |
var pool_max = 30; | |
var pool = 0; | |
var time = 0; | |
function post_loop(){ | |
if(pool > pool_max) { | |
// poll is full | |
setTimeout(function(){ | |
post_loop(time); | |
}, 5000); | |
return; | |
} | |
pool = pool + 1; | |
request.post({ | |
url: url, | |
body: "sjname=1&sjpass=23&Submit.x=13&Submit.y=11", | |
headers: { | |
'Origin': 'http://www.apple-vese.com', | |
"Accept-Encoding": "gzip,deflate,sdch", | |
"Accept-Language": "zh-CN,zh;q=0.8,en;q=0.6,nl;q=0.4,zh-TW;q=0.2,ja;q=0.2", | |
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36", | |
"Content-Type": "application/x-www-form-urlencoded", | |
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", | |
"Cache-Control": "max-age=0", | |
"Referer": "http://www.apple-vese.com/ICloud2.Asp", | |
"Connection:": "keep-alive", | |
}, | |
jar: j | |
}, function(error, response, body){ | |
time = time + 1; | |
console.log | |
console.log("request" + time); | |
post_loop(time); | |
pool = pool - 1; | |
}); | |
post_loop(); | |
} | |
post_loop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment