-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
51 lines (44 loc) · 1.6 KB
/
app.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
49
50
51
const axios = require("axios");
var fs = require("fs");
let {numbers, basicWords, namesM, namesF} = require("./words");
const results = [];
//Change words to a wordlist from line 1 if not wishing to run against every single list
//Example:
//const words = numbers;
//Otherwise, add them to the below array using the .../Spread syntax.
let words = [
...basicWords,
...namesM,
...namesF,
...numbers
];
(async () => {
//Display name must be 3-20 characters in length
words = words.filter(w => w.length >= 3 && w.length <= 20);
for (let w of words) {
const res = await axios({
method: 'post',
url: 'https://graphigo.prd.dlive.tv',
headers: {'content-type': 'application/json'},
data: {
"operationName": "ValidDisplayName",
"variables": {
"displayName": w
},
"query": "query ValidDisplayName($displayName: String!) {\n displayNameIsValid(displayName: $displayName)\n}\n"
}
});
const nameResult = {
name: w,
available: res.data.data.displayNameIsValid
}
console.log(nameResult);
results.push(nameResult);
};
const filterPass = results.filter(e => e.available);
console.log(`Found ${filterPass.length} available usernames, saving to file output.txt ...`);
fs.writeFileSync("output.txt", JSON.stringify(filterPass, null, 2), function(err, data) {
if (err) console.log(err);
console.log(`Successfully saved output to file.`);
});
})();