1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | function Plugin(crawler) {
|
7 |
|
8 | this.name = "Console-Plugin";
|
9 |
|
10 | }
|
11 |
|
12 |
|
13 | Plugin.prototype.crawl = function(result, $, callback) {
|
14 | console.log(result.statusCode + ',' + result.method + ',' +
|
15 | result.uri + ',' + result.responseTime + ',' + (result.proxy ? result.proxy : "no-proxy") );
|
16 | callback();
|
17 | }
|
18 |
|
19 | Plugin.prototype.error = function(error, result, callback) {
|
20 |
|
21 | console.log(error.code + ',ERROR,' +
|
22 | result.uri + ',no-response-time,' + (result.proxy ? result.proxy : "no-proxy"));
|
23 | callback();
|
24 |
|
25 | };
|
26 |
|
27 | Plugin.prototype.recrawl = function(error, result, callback) {
|
28 | console.log(error.code + ',RECRAWL(' + result.currentRetries + '),' +
|
29 | result.uri + ',no-response-time,' + (result.proxy ? result.proxy : "no-proxy") + " delay:" + result.retryTimeout);
|
30 | callback();
|
31 |
|
32 | };
|
33 |
|
34 |
|
35 | module.exports.Plugin = Plugin;
|