-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
41 lines (34 loc) · 801 Bytes
/
test.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
35
36
37
38
39
40
41
var exec = require('child_process').exec,cmd;
var curl = require('node-curl');
var fs = require('fs');
var async = require('async');
var filename = './urllist';
road_url = function(filename){
var url_list = [];
fs.readFileSync(filename,'utf8').toString().split('\n').forEach(function(line){
url_list.push(line);
});
return(url_list);
}
var result = null;
use_curl = function(url){
async.series([
function(next){
curl(url,function(err){
result = this.body;
next();
});
},function complete(err,results){
console.log('完了');
}
]);
return(result);
}
var url_list = road_url(filename);
/*
async.each(road_url(filename),function(data,next){
console.log(use_curl(data));
},function complete(err){
console.log('all done!');
});
*/