Skip to content

Instantly share code, notes, and snippets.

@qgustavor qgustavor/imgur-finder.js Secret

Created May 12, 2017
Embed
What would you like to do?
// open a imgur page and paste in the console
options = []
word = 'funny'
choices = 2 ** word.length
for (let i = 0; i < choices; i++) {
options.push(i.toString(2).padStart(word.length, 0)
.match(/./g).map((e, i) => +e?word[i].toUpperCase():word[i]).join(''))
}
options.reduce((last, option) => last.then(() => fetch(`http://i.imgur.com/${option}.png`, {
method: 'head',
redirect: 'error'
})).then(response => console.log(`http://i.imgur.com/${option}.png`)).catch(() => {}), Promise.resolve())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.