Last active
March 21, 2019 14:55
-
-
Save fuomag9/8f02b92e1bb83b25b711dc14dfa90831 to your computer and use it in GitHub Desktop.
clicca cuore auto periscope
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 clicca cuore auto periscope | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.pscp.tv/* | |
// @grant none | |
// ==/UserScript== | |
function click_spam() { | |
window.setInterval(function() { | |
document.getElementsByClassName("Touchable is-custom UserHeart")[0].click(); | |
document.getElementsByClassName("Touchable is-custom UserHeart")[0].click(); | |
document.getElementsByClassName("Touchable is-custom UserHeart")[0].click(); | |
}, 250); | |
} | |
(async function() { | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
await sleep(3000); | |
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
function loadjscssfile(filename, filetype) { | |
var fileref; | |
if (filetype == "js") { //if filename is a external JavaScript file | |
fileref = document.createElement('script') | |
fileref.setAttribute("type", "text/javascript") | |
fileref.setAttribute("src", filename) | |
} else if (filetype == "css") { //if filename is an external CSS file | |
fileref = document.createElement("link") | |
fileref.setAttribute("rel", "stylesheet") | |
fileref.setAttribute("type", "text/css") | |
fileref.setAttribute("href", filename) | |
} | |
if (typeof fileref != "undefined") { | |
document.getElementsByTagName("head")[0].appendChild(fileref) | |
} | |
} | |
loadjscssfile("https://gist.githubusercontent.com/fuomag9/de80ab9895e27a7502c8637cfc67257f/raw/0b4697d8653c4a7efb92bb1e235afebf282cd2bd/cssperiscope.css"); | |
var button_path = getElementByXpath("/html/body/div/div/div[1]/div[2]/div[2]/div[2]/div/div/div[3]/div/div[1]/div[2]/div[3]/div[1]"); | |
button_path.innerHTML += '<button class="orange" id="previewOrder">Ciao!</button>'; | |
document.getElementById("previewOrder").addEventListener("click", click_spam); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment