Skip to content

Instantly share code, notes, and snippets.

@EsmailELBoBDev2
EsmailELBoBDev2 / Reddit Upvoter
Created August 7, 2020 03:58
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...");