-
-
Save narze/97c65a501c735af5b182714fad1391cf to your computer and use it in GitHub Desktop.
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
async function run() { | |
const wait = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
const selector = 'div[aria-label="Toggle to follow"] div' | |
const nodes = [...document.querySelectorAll(selector)] | |
if (!nodes.length) return | |
for (let node of nodes) { | |
const text = node.parentElement.parentElement.parentElement.innerText | |
console.log(text) | |
if (!text.includes('Following')) { | |
// Remove Unfollowed node so that it will save some RAM | |
node.parentElement.parentElement.parentElement.parentElement.parentElement.remove() | |
continue | |
} | |
node.click() | |
await wait(100) | |
} | |
// Run again until no entries left | |
run() | |
} | |
// Click on the arrow on the upper right > settings and privacy > news feed preferences > unfollow > run this code on DevTools | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment