Skip to content

Instantly share code, notes, and snippets.

View kuzyn's full-sized avatar

kuzyn kuzyn

View GitHub Profile
@kuzyn
kuzyn / facebook-mass-delete-group-members.js
Last active March 3, 2016 15:03 — forked from AaronRM/facebook-mass-delete-group-members.js
This javascript removes all users from a facebook group. It works with the new facebook layout. Paste this in the javascript console. Script tested in Firefox. Known issues: 1. when facebook responds slowly, the script might experience hickups.. 2. occasionially, the error 'this user is not a member of the group' pops up.. IMPORTANT: add your ow…
var deleteAllGroupMembers = (function () {
var deleteAllGroupMembers = {};
// the facebook ids of the users that will not be removed.
// IMPORTANT: add your own facebook id here so that the script will not remove yourself!
var excludedFbIds = ['100009236033963','612270518']; // make sure each id is a string!
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start = function() {
// Removes all members from a facebook Group using Javascript
// by C. Ernesto López | https://facebook.com/c.ernest.1990
// Usage: First go to your Group, then go to Members, open the console (F12), paste the code and press ENTER
var groupid = document.getElementsByTagName('noscript')[0].innerHTML.split('/groups/')[1].split('/')[0];
var items = document.getElementsByName('fb_dtsg');
var fb_dtsg = items[ items.length - 1 ].value;
var y = 0;
var xhttp = new Array();
for( var x=0;x<document.getElementsByClassName('_ohe').length;x++ ) {