@@ -16,6 +16,7 @@ if (!program.args[0]) {
16
16
}
17
17
18
18
var chunk = [ ] ,
19
+ count = 0 ,
19
20
valid = 0 ,
20
21
invalid = 0 ,
21
22
c = new Crawler ( program . args [ 0 ] ) ;
@@ -33,17 +34,10 @@ c.on("fetchcomplete", function(item) {
33
34
chunk . push ( item . url ) ;
34
35
} ) ;
35
36
36
- c . on ( "fetch404" , function ( item , response ) {
37
- console . log ( chalk . red . bold ( "Not found:" ) , chalk . gray ( item . url ) ) ;
38
- } ) ;
39
-
40
- c . on ( "fetcherror" , function ( item , response ) {
41
- console . log ( chalk . red . bold ( "Fetch error:" ) , chalk . gray ( item . url ) ) ;
42
- } ) ;
43
-
44
37
c . on ( "complete" , function ( ) {
45
38
46
39
if ( chunk . length > 0 ) {
40
+ count = chunk . length ;
47
41
console . log ( chalk . white ( "Done! Validating..." ) ) ;
48
42
checkURL ( chunk ) ;
49
43
} else {
@@ -68,7 +62,7 @@ var checkURL = function(chunk) {
68
62
if ( chunk . length > 0 ) {
69
63
return checkURL ( chunk ) ;
70
64
} else {
71
- return console . log ( chalk . white ( "Checked %s sites. %s valid, %s invalid." ) , c . queue . complete ( ) , valid , invalid ) ;
65
+ return console . log ( chalk . white ( "Checked %s sites. %s valid, %s invalid." ) , count , valid , invalid ) ;
72
66
}
73
67
} ) ;
74
68
} ;
@@ -86,7 +80,7 @@ var font = c.addFetchCondition(function(parsedURL) {
86
80
} ) ;
87
81
88
82
var data = c . addFetchCondition ( function ( parsedURL ) {
89
- return ! parsedURL . path . match ( / \. ( j s o n | r s s | a t o m | g z | z i p | r a r | 7 z ) / i) ;
83
+ return ! parsedURL . path . match ( / \. ( j s o n | r s s | a t o m | g z | z i p | r a r | 7 z | v c f ) / i) ;
90
84
} ) ;
91
85
92
86
var misc = c . addFetchCondition ( function ( parsedURL ) {
0 commit comments