-
Notifications
You must be signed in to change notification settings - Fork 13
/
brute_names.js
35 lines (28 loc) · 1.02 KB
/
brute_names.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
var request = require('request')
, fs = require('fs')
, async = require('async')
, available = fs.createWriteStream('./available')
, processed = 0
, log
, reservedWords = ['post', 'session', 'join', 'apps', 'auth', 'list', 'root', 'phone']
/* queue of requests with a pool of 10 async */
, q = async.queue(function(task, callback) {
request('http://www.twitter.com/' + task.name, function (err, res) {
if(res && res.statusCode == 404) {
available.write(task.name + '\n')
}
callback(err)
})
}, 10)
/* read all dictionaries */
fileFirst = fs.readFileSync('./first.csv', 'utf8')
fileLast = fs.readFileSync('./last.csv', 'utf8')
fileFirst.split('\n').forEach(function(lineFirst) {
if(lineFirst < 4) return;
if(reservedWords.indexOf(lineFirst) > 0) return;
fileLast.split('\n').forEach(function(lineLast) {
/* push each first name with 3 different combinations */
q.push({name: lineFirst})
q.push({name: lineFirst + lineLast})
})
})