Skip to content

Instantly share code, notes, and snippets.

@nestarz
Created February 17, 2021 15:57
Show Gist options
  • Save nestarz/af0b3487274d786608ddfefb26bb9df0 to your computer and use it in GitHub Desktop.
Save nestarz/af0b3487274d786608ddfefb26bb9df0 to your computer and use it in GitHub Desktop.
Unlike all Facebook page
// 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