Created
January 9, 2017 23:37
-
-
Save anonymous/6a4dc6148c025e0cef70232d696b8433 to your computer and use it in GitHub Desktop.
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
// ==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