-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathapp.js
35 lines (31 loc) · 843 Bytes
/
app.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
//module by npm
var async = require('async');
//module by [email protected]
var config = require('./config.json');
var configMrg = require('./handler/configMrg.js');
var bookMrg = require('./handler/bookMrg.js');
//bookMrg.readBookList();
//return;
//新版,直接把小说名称放在robotBook.txt中就可以(小说间换行)
if(config.isInit) {
bookMrg.readBookList();
bookMrg.startRobot();
} else {
configMrg.init(function() {
bookMrg.readBookList();
bookMrg.startRobot();
});
}
//旧版一次只下载一个
return
var search = require('./handler/search.js');
var bookName = process.argv.splice(2)[0] || '';
if(bookName == '') {
console.log('please input bookName, example: node app.js 上仙')
return;
}
if(config.isInit) {
search.search(bookName);
} else {
configMrg.init(function() { search.search(bookName) });
}