Created
April 30, 2019 10:27
-
-
Save tomtom87/be3c93c8edd2ae43bb1057ed22b48071 to your computer and use it in GitHub Desktop.
Upvote everything on reddit
This file contains hidden or 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
// Run this on a subreddit to upvote everything!! | |
var simulateClick = function (elem) { | |
console.log('upvoted...'); | |
var evt = new MouseEvent('click', { | |
bubbles: true, | |
cancelable: true, | |
view: window | |
}); | |
var canceled = !elem.dispatchEvent(evt); | |
}; | |
var buttons = document.getElementsByTagName('button'); | |
for(var i = 0; i < buttons.length; i++){ | |
if(buttons[i].dataset.clickId == 'upvote'){ | |
setTimeout(simulateClick, (Math.floor(Math.random() * 32000) + 1),buttons[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just run in console and it will upvote the entire sub