Last active
March 11, 2020 09:29
-
-
Save fritschy/54147448b89711d8d3f5cf001776cb80 to your computer and use it in GitHub Desktop.
Unsave/Unlike reddit posts JS snippet
This file contains 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
// Paste to firefox js console | |
// Source: https://stackoverflow.com/a/59443772 | |
// XXX unsave posts | |
const delay = ms => new Promise(res => setTimeout(res, ms)); | |
(async () => { | |
for (const a of document.querySelectorAll('.link-unsave-button > a, .comment-unsave-button > a')) { | |
a.click(); | |
await delay(300); | |
} | |
console.log('done'); | |
})(); | |
// XXX unlike posts | |
const delay = ms => new Promise(res => setTimeout(res, ms)); | |
(async () => { | |
for (const a of document.querySelectorAll('div.arrow.upmod.login-required.access-required')) { | |
a.click(); | |
await delay(100); | |
} | |
console.log('done'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment