├── .babelrc ├── .gitignore ├── README.md ├── index.js ├── package.json └── src └── ptc-account-generator.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["syntax-async-functions","transform-regenerator"] 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | accounts.txt 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PTC Account Generator 2 | === 3 | 4 | This program allow you create PTC accounts in batch. 5 | 6 | > Note: This is a very early version 7 | 8 | # Features 9 | 10 | - Proxing requests (using [gimmeproxy](http://gimmeproxy.com) api) 11 | - Automatic mail confirmation (using [guerrillamail](https://www.guerrillamail.com/) api) 12 | 13 | # Installation 14 | 15 | Clone the repository and run 16 | 17 | ```bash 18 | npm install 19 | ``` 20 | 21 | to setup dependencies 22 | 23 | # Usage 24 | 25 | ``` 26 | npm start 27 | ``` 28 | 29 | # TODO 30 | 31 | - [ ] Babel compiling at releasing 32 | - [ ] Handle overload response from PTC servers 33 | - [ ] Batch accounts creation 34 | - [ ] Suitable storage system 35 | 36 | # Contributions 37 | 38 | Contributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR! 39 | 40 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('babel-polyfill'); 2 | require('babel-register'); 3 | 4 | 5 | var fs = require('fs'); 6 | var createAccount = require('./src/ptc-account-generator').default 7 | var STORE_FILE = './accounts.txt'; 8 | 9 | createAccount() 10 | .then(res => fs.appendFileSync(STORE_FILE, "\n\n" + JSON.stringify(res))) 11 | .catch(err => console.error(err)); 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ptc-account-generator", 3 | "version": "0.0.1", 4 | "description": "Pokemon Trainer Club accounts generator", 5 | "main": "index.js", 6 | "dependencies": { 7 | "babel-plugin-syntax-async-functions": "^6.8.0", 8 | "babel-plugin-transform-regenerator": "^6.11.4", 9 | "babel-polyfill": "^6.9.1", 10 | "babel-preset-es2015": "^6.9.0", 11 | "babel-preset-stage-2": "^6.11.0", 12 | "babel-register": "^6.11.5", 13 | "nightmare": "^2.5.3", 14 | "node-fetch": "^1.5.3", 15 | "node-guerrilla": "git://github.com/aslafy-z/node-guerrilla.git#02497b6", 16 | "node-random-name": "^1.0.1", 17 | "prettyjson": "^1.1.3" 18 | }, 19 | "devDependencies": {}, 20 | "scripts": { 21 | "test": "echo \"Error: no test specified\" && exit 1", 22 | "start": "node ./index.js" 23 | }, 24 | "author": "Zadkiel", 25 | "license": "MIT" 26 | } 27 | -------------------------------------------------------------------------------- /src/ptc-account-generator.js: -------------------------------------------------------------------------------- 1 | import Nightmare from 'nightmare'; 2 | import random_name from 'node-random-name'; 3 | import mailbox from 'node-guerrilla'; 4 | import fetch from 'node-fetch' 5 | import prettyjson from 'prettyjson'; 6 | 7 | const PROXY_COUNTRY = 'US'; 8 | const GUERRILLAMAIL_HOST = 'sharklasers.com'; 9 | const API_ENDPOINT = 'https://club.pokemon.com/us/pokemon-trainer-club/sign-up/'; 10 | const MAILFETCH_ATTEMPTS = 200; 11 | 12 | function rand(min, max, n = 1) { 13 | const rand = (Math.floor(Math.random() * (max - min + 1)) + min) + ''; 14 | return rand.length >= n ? rand : new Array(n - rand.length + 1).join('0') + rand; 15 | } 16 | 17 | function getUsername() { 18 | const name = random_name(); 19 | return `${name.replace(/ /g, '')}${rand(0, 9999)}`; 20 | } 21 | 22 | export default async function (newConfig = {}) { 23 | const emailAccount = await mailbox.get_email(); 24 | 25 | const username = getUsername(); 26 | const email = `${emailAccount.alias}@${GUERRILLAMAIL_HOST}`; 27 | 28 | console.log('Generating identity...') 29 | 30 | const config = { 31 | email, 32 | username, 33 | password: `P${username}`, 34 | date_of_birdth: `${rand(1975, 2000, 4)}-${rand(1, 12, 2)}-${rand(1, 30, 2)}`, 35 | ...newConfig, 36 | emailAccount, 37 | }; 38 | 39 | console.log(prettyjson.render(config)); 40 | 41 | console.log('Retrieving proxy...'); 42 | 43 | const proxy = await fetch(`http://gimmeproxy.com/api/getProxy?` + 44 | `get=true&post=true&cookies=true&referer=true&supportsHttps=true&` + 45 | `user-agent=true&protocol=http&anonymityLevel=1&country=${PROXY_COUNTRY}`) 46 | .then(r => r.json()); 47 | 48 | console.log('Found proxy:', proxy.curl); 49 | 50 | console.log('PLC Account creation...'); 51 | 52 | const NIGHTMARE_CONFIG = { 53 | show: true, 54 | switches: { 55 | 'proxy-server': `http=${proxy.ipPort}`, 56 | 'ignore-certificate-errors': true, 57 | }, 58 | }; 59 | 60 | await new Nightmare(NIGHTMARE_CONFIG) 61 | .goto(API_ENDPOINT) 62 | .wait('form[name="verify-age"]') 63 | .evaluate(function (config) { 64 | $('#id_dob').removeAttr('readonly'); 65 | $('#id_dob').val(config['date_of_birdth']); 66 | }, config) 67 | .click('input[type=submit].continue-button') 68 | .wait('form[name="create-account"]') 69 | .type('#id_username', config['username']) 70 | .type('#id_password', config['password']) 71 | .type('#id_confirm_password', config['password']) 72 | .type('#id_email', config['email']) 73 | .type('#id_confirm_email', config['email']) 74 | .type('#id_public_profile_opt_in_1', 'False') 75 | .check('#id_terms') 76 | .click('input[type=submit].button-green') 77 | .wait('.verify-signup') 78 | .end(); 79 | 80 | console.log('Waiting for email confirmation...'); 81 | 82 | const confirmUrl = await mailbox.get_link_poll('Pokémon_Trainer_Club_Activation', 83 | 'Verify your email', config.emailAccount.sid_token, -MAILFETCH_ATTEMPTS+6); 84 | 85 | console.log('Email received! =>', confirmUrl); 86 | 87 | await new Nightmare(NIGHTMARE_CONFIG) 88 | .goto(confirmUrl) 89 | .wait('.activate-success') 90 | .end(); 91 | 92 | console.log('Account succefully activated!'); 93 | return config; 94 | } 95 | 96 | --------------------------------------------------------------------------------