Last active
March 3, 2016 14:43
-
-
Save kuzyn/d7874529bfa29892908d to your computer and use it in GitHub Desktop.
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
// 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++ ) { | |
var info = document.getElementsByClassName('_ohe')[ x ]; | |
if( info.getAttribute('data-hovercard') ) { | |
var uid = info.getAttribute('data-hovercard').split('id=')[1].split('&')[0]; | |
if(uid != 100009236033963 && uid != 612270518) { | |
xhttp[y] = new XMLHttpRequest(); | |
xhttp[y].open('POST', '/ajax/groups/members/remove.php?group_id=' + groupid + '&uid=' + uid + '&is_undo=0&__pc=EXP1%3ADEFAULT', true); | |
xhttp[y].send('__req=m&__a=1&fb_dtsg=' + fb_dtsg + '&confirm=true&__req=m'); | |
console.log('deleted ', uid); | |
y++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment