-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.js
87 lines (64 loc) · 3.39 KB
/
index.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// this only generates chess.com accounts and not nitro codes.
// for nitro code generator, contact me on discord @uutu or on telegram @tahagorme
const { connect } = require("puppeteer-real-browser")
const fs = require('fs');
const prompt = require("prompt-sync")({ sigint: true });
async function test() {
const { browser, page } = await connect({
headless: false,
args: [],
customConfig: {},
turnstile: true,
connectOption: {},
disableXvfb: false,
ignoreAllFlags: false
// proxy:{
// host:'<proxy-host>',
// port:'<proxy-port>',
// username:'<proxy-username>',
// password:'<proxy-password>'
// }
})
let randomEmail = randomString(15) + '@outlook.com';
let randomUsername = randomString(15);
let randomPassword = randomString(15) + randomIntFromInterval(100000, 9999999);
console.log(randomEmail)
await page.goto('https://www.chess.com/register')
await page.waitForSelector("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > div > button")
await page.click("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > div > button")
await page.waitForSelector("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > form > div:nth-child(1) > button")
await page.click("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > form > div:nth-child(1) > button")
await page.waitForSelector("#registration_email")
await page.type("#registration_email", randomEmail)
await page.waitForSelector("#registration_password")
await page.type("#registration_password", randomPassword)
await page.waitForSelector("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > form > div:nth-child(6) > button")
await page.click("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > form > div:nth-child(6) > button")
await page.waitForSelector("#registration_username")
await new Promise(r => setTimeout(r, 500))
await page.type("#registration_username", randomUsername)
await page.waitForSelector("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > form > div:nth-child(7) > div > div.username-wrap > button")
await new Promise(r => setTimeout(r, 500))
await page.click("body > div:nth-child(1) > div > div.security-onboarding-container > main > div > form > div:nth-child(7) > div > div.username-wrap > button")
await page.waitForNavigation();
console.log(`Account Created --> ${randomEmail} : ${randomPassword}`)
//save cookies to file
await new Promise(r => setTimeout(r, 1000))
test();
}
let noOfThreads = prompt('Enter number of threads: ');
for (let i = 0; i < noOfThreads; i++) {
test();
}
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min)
}
function randomString(length) {
var result = ''
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
var charactersLength = characters.length
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength))
}
return result
}