Last active
December 29, 2019 13:45
-
-
Save 0xFaisal/5a40e57d13e90b5650e7cb0d9f32ef0f to your computer and use it in GitHub Desktop.
TwitterKIT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// packages - | |
const fetch = require('node-fetch'); | |
const chalk = require('chalk') | |
const fs = require('fs') | |
// متغيرات مالها داعي | |
const url = `https://twitter.com/users/email_available?email=` | |
// هنا الشغل ): | |
function check_email ( filename ) { | |
var taken = ""; | |
var nottaken = ""; | |
var emails = ''; | |
fs.readFile(`./${filename}`, 'utf8', (err, data) => { | |
if(err) throw err; | |
emails = data; | |
}) | |
setTimeout( function ( ) { | |
let new2 = emails.split('\n'); | |
new2= new2.map(v => { | |
fetch(url + v) | |
.then(res => res.json()) | |
.then(json => { | |
if(json.taken == true) { | |
console.log(chalk.red(json.msg.replace('An email can only be used on one Twitter account at a time.', ' ') + v)) | |
taken += v; | |
fs.writeFile('taken.txt', taken, (err) => { | |
if (err) throw err; | |
}); | |
} else { | |
console.log(chalk.green(json.msg + ' ' + v)) | |
nottaken += v; | |
fs.writeFile('nottaken.txt', nottaken, (err) => { | |
if (err) throw err; | |
}); | |
} | |
}) | |
}) | |
}, 1000) | |
} | |
// run | |
check_email('emails.txt') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment