Skip to content

Instantly share code, notes, and snippets.

@tomtom87
Created April 30, 2019 10:27
Show Gist options
  • Save tomtom87/be3c93c8edd2ae43bb1057ed22b48071 to your computer and use it in GitHub Desktop.
Save tomtom87/be3c93c8edd2ae43bb1057ed22b48071 to your computer and use it in GitHub Desktop.
Upvote everything on reddit
// 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]);
}
}
@tomtom87
Copy link
Author

Just run in console and it will upvote the entire sub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment