Skip to content

Instantly share code, notes, and snippets.

@EsmailELBoBDev2
Created August 7, 2020 03:58
Show Gist options
  • Save EsmailELBoBDev2/6533b4d9533350c8ee455fbe8913964a to your computer and use it in GitHub Desktop.
Save EsmailELBoBDev2/6533b4d9533350c8ee455fbe8913964a to your computer and use it in GitHub Desktop.
It's a JS script to upvote reddit posts automatically
function upvote() {
document.querySelectorAll('[data-click-id="upvote"]').forEach((b, i) => {
setTimeout(() => {
if (b.getAttribute("aria-pressed") == "true") {
console.log("already upvoted...");
} else if (b.getAttribute("aria-pressed") == "false") {
b.click();
console.log("upvoting...");
} else {
console.log("something went wrong...");
}
}, i * 1000);
});
}
upvote()
@GitOverHere
Copy link

epic scipt bro

@roeravid
Copy link

Super clean

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