-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
38 lines (35 loc) · 992 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
var FS = require("q-io/fs");
var Q = require('q');
var qhttp = require('q-io/http');
var r = new RegExp("(goo\.gl/[A-Za-z0-9]{6})",'g');
//wget -r https://developers.google.com
// grep -r "[^/]goo\.gl/" . > ../tmp/google.txt
FS.read('google.txt').then(function(file){
var a = file.split('\n'),
hash = '',
map = {},
found = {
"goo.gl/K6E7l8":true,
"goo.gl/Tw6kP9":true,
"goo.gl/xZM9jt":true,
"goo.gl/q7wKp8":true,
"goo.gl/1nToQ4":true,
"goo.gl/5nz6cg":true,
"goo.gl/5FwCJy":true,
"goo.gl/Au49Um":true,
"goo.gl/hmgbrW":true,
"goo.gl/T3mzjk":true
};
for( var i=0, l=a.length; i<l; i++ ){
//console.log(a[i]);
try{
hash = r.exec(a[i])[1];
if( !found[hash] )
map[hash] = hash;
}catch(e){
}
}
for( var i in map ){
console.log(i);
}
});