Skip to content

Instantly share code, notes, and snippets.

@JamesMarino
Last active February 24, 2022 21:01
Show Gist options
  • Save JamesMarino/3b5d08e1e56140cad4ad6e3a1e69a59b to your computer and use it in GitHub Desktop.
Save JamesMarino/3b5d08e1e56140cad4ad6e3a1e69a59b to your computer and use it in GitHub Desktop.
Unlike All Pages Facebook
// 1. Navigate to https://www.facebook.com/pages/?category=liked
// 2. Open up console and run the below, it will unlike all the current shown liked pages
const buttons = document.getElementsByTagName('button');
const likedText = 'Liked';
for (let button of buttons) {
if (button.innerHTML && button.innerHTML.includes()) {
button.click(likedText);
}
}
@JamesMarino
Copy link
Author

Any suggestions for an improvement @ahmedcfx - Facebook must have updated the HTML structure on the page. Could look into an official API - maybe they have one now?

@SAFAD
Copy link

SAFAD commented Feb 24, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment