-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathproxyTest.js
34 lines (27 loc) · 848 Bytes
/
proxyTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Created by lenovo on 2014/9/17.
*/
var fs = require("fs");
var Request = require('request');
fs.readFile("proxy.txt",{encoding:"utf-8"}, function(err,content){
content.split("\r\n").forEach(function(item){
if(item){
var request = Request.defaults({proxy:"http://" + item});
request({uri:"http://s.weibo.com/",encoding:"utf-8"},function(err,response,body){
if(err){
// console.log(err);
return;
}
var matched = body.match(/\.css\?version=2012/gm);
if(matched){
// console.log(matched);
console.log(item);
}
else{
// console.log("Not match");
}
});
}
});
});
return;