Last active
April 9, 2018 23:30
-
-
Save AhmedKamal20/7e38c0419b864e964c91f82590d95f0d to your computer and use it in GitHub Desktop.
To Mass Unfollow Friends, Pages & Groups on Facebook
This file contains 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
// 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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based On this Quora Answer