Skip to content

Instantly share code, notes, and snippets.

@progcode
Last active March 7, 2017 14:35
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 progcode/5db32096636bce8220bfcae9615f6dfe to your computer and use it in GitHub Desktop.
Save progcode/5db32096636bce8220bfcae9615f6dfe to your computer and use it in GitHub Desktop.
ClickBot.js
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