Created
February 17, 2021 15:57
-
-
Save nestarz/af0b3487274d786608ddfefb26bb9df0 to your computer and use it in GitHub Desktop.
Unlike all Facebook page
This file contains hidden or 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
// go to https://www.facebook.com/pages/?category=liked&ref=bookmarks | |
let pages = [] | |
const unlike_all = () => { | |
const all = [...document | |
.querySelectorAll('[aria-label="Liked"],[aria-label="Followed"],[aria-label="Following"]') | |
] | |
pages = [...new Set([...pages, ...all.map((a) => a.parentNode.parentNode.querySelector("span").innerText.trim(" "))])] | |
console.log(pages); | |
copy(pages); | |
all.forEach((a) => a.click()); | |
window.scrollTo(0, document.body.scrollHeight); | |
// You will also need to scroll manually times to times or to speed up the process | |
window.setTimeout(unlike_all, 3 * 1000); | |
} | |
unlike_all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment