Skip to content

Instantly share code, notes, and snippets.

@AhmedKamal20
Last active April 9, 2018 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AhmedKamal20/7e38c0419b864e964c91f82590d95f0d to your computer and use it in GitHub Desktop.
Save AhmedKamal20/7e38c0419b864e964c91f82590d95f0d to your computer and use it in GitHub Desktop.
To Mass Unfollow Friends, Pages & Groups on Facebook
// Version: 0.2
// Author: Ahmed Kamal (AhmedKamal20)
// About : To Mass Unfollow Friends, Pages & Groups
// It'll Unfollow first ~250 (or more) from selected category
// It's kinda slow, but to avoid getting blocked by Facebook
// Usage :
// Open (News Feed Preferences) from the right menu
// Choose (Unfollow people to hide their posts)
// Select between All, Friends Only, Pages Only, Groups Only
// Then open the console and paste the following
var unfollow = document.querySelector('[data-testid="unfollow"]');
var scrollable = unfollow.querySelector(".scrollable");
var posters = unfollow.querySelectorAll("._5u3n");
var done = unfollow.querySelector("._2-ks");
var i = 0;
var time = 1000;
var pages = 10;
function scroll(){
scrollable.scrollTop = scrollable.scrollHeight;
if ( i++ < pages ) {
setTimeout(scroll, time*5);
} else {
i = 0;
setTimeout(function(){
posters = unfollow.querySelectorAll("._5u3n");
console.log(posters.length);
start();
}, time*5);
}
}
function start(){
console.log(i);
posters[i].click();
if ( i++ < posters.length - 1 ) {
setTimeout(start, time);
} else {
done.click();
new Audio("https://freesound.org/data/previews/423/423619_2155630-lq.mp3").play();
}
}
scroll();
@AhmedKamal20
Copy link
Author

Based On this Quora Answer

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