问题
I am the admin of a several-years-old Facebook group that has since been overrun by scam accounts (700 or so of them). There are far too many members for me to, realistically, manually remove them - as Facebook recommends.
Here is the link to the group: https://www.facebook.com/groups/101697209943412
I understand that many websites offer JavaScript to perform member removal in bulk; however, I also understand that most of these scripts are toxic and can give control of your page to their developers/other people.
I thought I'd ask StackOverflow for a clean batch of code, in hopes that the community here has more integrity than the internet at large.
回答1:
Try this
var j = 4;
function kickAll() {
document.getElementsByClassName("_55pe")[j].click();
setTimeout(function() { document.getElementsByClassName("_54nh")[1].click(); }, 3500);
setTimeout(function() { document.getElementsByClassName("_42ft _4jy0 layerConfirm uiOverlayButton _4jy3 _4jy1 selected _51sy")[0].click(); }, 6000);
j++;
setTimeout(function() { wait(); }, 10000);
}
function wait() {
if(document.getElementsByClassName("_42ft _4jy0 layerConfirm uiOverlayButton _4jy3 _4jy1 selected _51sy")[0] == undefined) { kickAll(); }
else { document.getElementsByClassName("_54nh")[1].click(); wait(); }
}
kickAll();
Also, when in the console you might get an error 'document is not defined', if so, check that the top-left dropdown box is set to '<top frame>
'
来源:https://stackoverflow.com/questions/35024262/javascript-remove-all-members-from-an-old-facebook-group-in-bulk