Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2017 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6a4dc6148c025e0cef70232d696b8433 to your computer and use it in GitHub Desktop.
Save anonymous/6a4dc6148c025e0cef70232d696b8433 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name roll-prnt.scr
// @namespace RollScreen
// @include http://prnt.sc/*
// @version 1
// @grant none
// ==/UserScript==
// create roll
var roll = document.createElement("div");
roll.innerHTML = '<div>Roll</div>';
roll.onclick = function()
{
var gen ='', abd ='abcdefghijklmnopqrstuvwxyz0123456789', aL = abd.length;
while(gen.length < 6)
gen += abd[Math.random() * aL|0];
location.href = 'http://prnt.sc/' + gen;
return false;
}
document.body.insertBefore(roll, document.body.firstChild);
// auto roll if error
if (document.documentElement.innerHTML.indexOf('https://img-fotki.yandex.ru/get/49649/5191850.0/0_173a7b_211be8ff_orig') != -1)
roll.onclick();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment