Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.