Last active
March 7, 2017 14:35
-
-
Save progcode/5db32096636bce8220bfcae9615f6dfe to your computer and use it in GitHub Desktop.
ClickBot.js
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
function simulateUserClick(url) { | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function() { | |
if (this.readyState == 4 && this.status == 200) { | |
console.log('send'); | |
} | |
}; | |
xhttp.open("GET", url,true); | |
xhttp.send(); | |
} | |
ClickBot = { | |
start: function() { | |
this.clickInterval = setInterval(function(){ | |
var url = document.getElementById("link").href; | |
simulateUserClick(url); | |
}, 1000); | |
}, | |
stop: function() { | |
clearInterval(this.clickInterval); | |
} | |
}; | |
ClickBot.start(); | |
// ClickBot.stop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment