-
Notifications
You must be signed in to change notification settings - Fork 3
/
spider.js
48 lines (40 loc) · 897 Bytes
/
spider.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
42
43
44
45
46
47
48
var ClientApi = require('./clientapi');
var clientapi = new ClientApi(this.config);
function Spider(config) {
this.config = config;
}
Spider.prototype.scan = function scan() {
var params = [
{
key: "apikey",
value: this.config.apiKey
},
{
key: "url",
value: this.config.target
},
{
key: "maxChildren",
value: ""
}
];
this.config.component = "spider";
this.config.operationType = "action";
this.config.operationname = "scan";
this.config.params = params;
return clientapi.callApi(this.config);
};
Spider.prototype.status = function status(scanId) {
var params = [
{
key: "scanId",
value: scanId
}
];
this.config.component = "spider";
this.config.operationType = "view";
this.config.operationname = "status";
this.config.params = params;
return clientapi.callApi(this.config);
};
module.exports = Spider;