Skip to content

Instantly share code, notes, and snippets.

@starve-l
Last active November 9, 2021 20:21
Show Gist options
  • Save starve-l/b9951a563ac65226fa164a6ed5375139 to your computer and use it in GitHub Desktop.
Save starve-l/b9951a563ac65226fa164a6ed5375139 to your computer and use it in GitHub Desktop.
Returns an URI string leading to a random `prnt.sc` post. Works est. 9/10 times.
let char: String = "abcdefghijklmnopqrstuvwxyz0123456789";
let randomImage = () => {
let str: String = "";
for (let i = 0; i < 6; i++) {
str += char.charAt(Math.floor(Math.random() * char.length));
}
return `https://prnt.sc/${str}`;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment