Hacker News new | ask | show | jobs
by axelfreeman 3499 days ago
I had a lot of fun automate this game and see the results.

setInterval(function() {document.getElementsByTagName("a")[Math.floor(Math.random() * document.getElementsByTagName("a").length)].click()}, 5000)

1 comments

or may be this: window.setInterval(function(){ [].forEach.call(document.querySelectorAll('a'), function (el){el.click();});},500)
It's funny to see the different variations. I used: `var x = setInterval(() => { for (element of document.getElementsByTagName('a')) { element.click() } }, 1000);`