// 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();