Delete all members of a Facebook group and delete a facebook group

Facebook groups has been around for a long time. Facebook groups has been mostly used for selling things online and is a good alternative for sites like ebay and other selling/action sites basically because it is free and you mostly sell to your target market.

Some people like me admin/own some facebook groups and there are instances that we want to delete a group to create a new one or simply remove the group since it is not being used anymore. Unfortunately for facebook there is no automated way of doing it within their website.

To delete a facebook group, you have to first remove all the members of the group and then you will have to leave the group to complete remove that group. If you have like 50k+ members, removing them one by one is such a big task and will eat up a lot of your time.

Here is an automated way to remove the members of your group. You will need to either use google chrome or mozilla firefox and leave it open while the script is running.

  1. Open the facebook group and browse the members link
  2. Scroll to the bottom of the page and click on “see more”
  3. Now open up your browser the console for your browser. For google chrome the shortcut is “ctrl + shift + j” and for firefox it is “ctrl + shift + k”
  4. paste the code below in the console and let it run and do it’s own thing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
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 = ['jessica.manoo.7']; // make sure each id is a string!
var totalDeleted = 0;
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start =
function()
{
scriptEnabled = true;
deleteAll();
};
deleteAllGroupMembers.stop = function()
{
scriptEnabled = false;
};
function deleteAll()
{
if (scriptEnabled)
{
queueMembersToDelete();
processQueue();
}
}

function queueMembersToDelete()
{
var adminActions = document.getElementsByClassName('adminActions');
console.log(excludedFbIds);
for(var i=0; i<adminActions.length; i++)
{
var gearWheelIconDiv = adminActions[i];
var hyperlinksInAdminDialog = gearWheelIconDiv.getElementsByTagName('button')[0];
//var fbMemberId = gearWheelIconDiv.parentNode.parentNode.id.replace('member_','');
//var fbMemberName = getTextFromElement(gearWheelIconDiv.parentNode.parentNode.getElementsByClassName('fcb')[0]);
var fbMemberName = gearWheelIconDiv.parentNode.parentNode.parentNode.children[0].children[0].text;
if (gearWheelIconDiv.parentNode.parentNode.parentNode.children[0].children[0].attributes[0] == null)
continue;
var str = gearWheelIconDiv.parentNode.parentNode.parentNode.children[0].children[0].attributes[0].value;

str = str.substring(str.indexOf('.com') + 5);
fbMemberId = str.substring(0,str.indexOf('?'));
if (excludedFbIds.indexOf(fbMemberId) != -1)
{
console.log("SKIPPING "+fbMemberName+' ('+fbMemberId+')');
continue;
}
else
{
console.log('Queing: ' + fbMemberName+ ', (' + fbMemberId + ')');
usersToDeleteQueue.push({'memberId': fbMemberId, 'gearWheelIconDiv': gearWheelIconDiv});
}
}
}

function processQueue()
{
if (!scriptEnabled)
{
return;
}
if (usersToDeleteQueue.length > 0)
{
removeNext();
setTimeout(
function()
{
processQueue();
},1000);
}
else
{
getMore();
}
}
function removeNext()
{
if (!scriptEnabled)
{
return;
}
if (usersToDeleteQueue.length > 0)
{
var nextElement = usersToDeleteQueue.pop();
removeMember(nextElement.memberId, nextElement.gearWheelIconDiv);
}
}
function removeMember(memberId, gearWheelIconDiv) {
if (processing)
{
return;
}
var gearWheelHref = gearWheelIconDiv.getElementsByTagName('button')[0];
gearWheelHref.click();
processing = true;
setTimeout(
function()
{
var popupRef = gearWheelHref.id;
var popupDiv = getElementByAttribute('data-ownerid',popupRef);
var popupLinks = popupDiv.getElementsByTagName('a');
for(var j=0; j<popupLinks.length; j++)
{
if (popupLinks[j].getAttribute('href').indexOf('remove.php') !== -1)
{
// this is the remove link
popupLinks[j].click();
setTimeout(function(){
var confirmButton = document.getElementsByClassName('layerConfirm uiOverlayButton selected')[0];
var errorDialog = getElementByAttribute('data-reactid','.4.0');
if (confirmButton != null) {
if (canClick(confirmButton)) {
confirmButton.click();
} else {
console.log('This should not happen memberid: '+memberId);
5/0;
console.log(gearWheelIconDiv);
}
}
if (errorDialog != null) {
console.log("Error while removing member "+memberId);
errorDialog.getElementsByClassName('selected layerCancel autofocus')[0].click();
}
else
{
console.log("Now Deleting "+ memberId + ', (' + totalDeleted + ')');
totalDeleted = totalDeleted + 1;
}
processing = false;
},1500);
continue;
}
}
},1000);
}
function canClick(el)
{
return (typeof el != 'undefined') && (typeof el.click != 'undefined');
}
function getMore()
{
processing = true;
more = document.getElementsByClassName("pam uiBoxLightblue uiMorePagerPrimary");
if (typeof more != 'undefined' && canClick(more[0]))
{
more[0].click();
setTimeout(
function()
{
deleteAll();
processing = false;
}, 4000);
}
else
{
deleteAllGroupMembers.stop();
}
}
function getTextFromElement(element)
{
var text = element.textContent;
return text;
}
function getElementByAttribute(attr, value, root)
{
root = root || document.body;
if(root.hasAttribute(attr) && root.getAttribute(attr) == value)
{
return root;
}
var children = root.children,
element;
for(var i = children.length; i--; )
{
element = getElementByAttribute(attr, value, children[i]);
if(element)
{
return element;
}
}
return null;
}

return deleteAllGroupMembers;
})();
deleteAllGroupMembers.start();

Let me know in the comments section if this works out for you. I’ve used it just today and it seems to be working fine. Please take note that facebook updates their website from time to time and change the code, so the code above might stop working after sometime.

Minimalist Linux Desktop

Got bored this afternoon so I decided to change the desktop yet again. You see I think this is one problem most Linux users run in to. Because of so much things you can do with the operating system and the amount of control that you have over it, people tend not to stay into one setting or one app. Everything keeps changing, keeps getting updated, new stuff comes out all the time.

Anyway I stumbled upon a few bits and pieces and combined them and came up with this

Current Desktop... Desktop

So I reformatted my main desktop yesterday and it is set to run exclusively on linux. I felt like the only thing that was stopping me from removing windows was Dota 2, which actually runs fine in Linux. I checked programs I was running on the desktop with windows and most if not all of them have open source equivalents.

So I spent sometime configuring my desktop and came up with this. I still need to work on my creativity.

Linux Mint 18 Dell Inspiron 5521 Fan Issue Fix

Last month I decided to upgrade my Dell laptop to Linux Mint 18 (Sarah) from Linux Mint 17.3. I have been using linux mint as a daily driver for that laptop and so far I have no issues with it until after upgrading to linux mint 18.

The fans on my laptop kept running at full speed even if its idle. A quick google search and I found out that I am not the only one having the issue. It does seem like it is a common issue with Dell laptops not just the model that I own and it is not specific with linux mint as well.

I did try to configure a lot of things including changing settings in acpi to linux but that did not seem to help. I found out about i8kutils during the process but after installing it, the fans just stopped working for a few seconds then went back to it’s merry own way of running at full speed.

Installing lm-sensors (sudo apt-get install lm-sensors) did not show that it detected any fans on my system (an update to this after a kernel upgrade provided by linux mint, running lm-sensors now show that it detects a fan and shows the fan speed) even though you can hear the fan physicall running.

Please watch the video below on how I fixed the issue for my machine. It might or might not work for you but it is worth a try anyway. This might also work for other Dell laptops not just the model that I have. If it does work for you please leave a comment here or on my youtube video and please state the dell laptop model you used it on to help other people.

My config file below (i8kmon.conf)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Run as daemon, override with --daemon option
set config(daemon) 0

# Automatic fan control, override with --auto option
set config(auto) 1

# Report status on stdout, override with --verbose option
set config(verbose) 1

# Status check timeout (seconds), override with --timeout option
set config(timeout) 20

# Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
set config(0) {{-1 0} -1 40 -1 40}
set config(1) {{-1 1} 30 60 30 60}
set config(2) {{-1 2} 59 100 59 100}

# For computer with 2 fans, use a variant of this instead:
# Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
# set config(0) {{-1 0} -1 52 -1 65}
# set config(1) {{-1 1} 41 66 55 75}
# set config(2) {{-1 1} 55 80 65 85}
# set config(3) {{-1 2} 70 128 75 128}

# end of file

BSD = Unilimited Headache

I started out my linux adventures via slackware linux. Now I am using the easiest way out Linux Mint just because I am getting old and when you get old there are a lot of things you best spend your time on. Back then everyone was playing with their redhat and I insisted that I wanted something out of the box. I still remember my happy mother when I ask her to buy me a book that was so thick and was quite expensive. It was a Linux for dummies book because I wanted to learn how to use the operating system and internet back then was a real pain in the ass. Google was not yet conceived so there was really not much for me to get the information from.

When I started with slackware I can still remember the 2 drives that died on me during the process for installing, removing, re-installing, partition, re-partition but I did learn a few bits here and there. Back then linux package management was not yet the thing. You have to download and compile including the dependencies for a program to be installed in slackware.

Fast forward this year, I got bored and said to myself that I really want to try and learn a fair bit of BSD. So I downloaded the iso and for testing purposes installed it in a virtual machine (thank God for the people who created those things). Yep it was a pain but using it brings back the slackware days during my younger years. Make, make install, tar etc etc. It’s only now that I understood what it meant by slackware is most unix like linux distro. So I guess having experience with slackware did help me with playing around with BSD.

I did have some old hardware I was planning to use BSD on and use the machine as my home server but unfortunately life is hard nowadays and I don’t really have the extra means to buy western digital red nas drives. Maybe in time I can learn more about bsd and the infamous file system they are using and be able to apply it on my home server but for now I will play around with it inside the virtual box. I might be able to score some cheap 250gb hdd soon and use that as my main bsd drive and dual boot the desktop.

For people who want to venture into BSD, I would suggest you read up the Freebsd manual its really quite good and has a lot of information. Let’s face it if you have no experience with BSD the first thing that will come to your mind would be FreeBSD. Be prepared for the unlimited headache you will get though, chances are some of your hardware requires a lot of configuring to do. Some of your linux application might not have been ported to FreeBSD. You might need to compile one on your own.

Dead Liquid Cooling

So I woke up today and turned on my desktop… 2x120mm AIO fans unusually running at full speed. I check speed and fan and my processor was burning. So I turned off my desktop and quickly checked inside bios and found out that the pump was not reporting any activity. I switched the pump fan header to a different fan header on my system board and turned on the machine. Result = SAME

My tower before the pump died

So I took out the OEM Intel fan that I had and quickly installed it hoping I would get the same result (hoping that the AIO pump was not dead) but viola the system temps were back to normal. So as it stand my Deepcool gamerstorm 240MM AIO pump is dead. The fans run but the stupid pump is dead.

Oh well the system is now back up to normal using the original OEM Intel fan. I am thinking of keeping it this way for a bit since I am due for a system upgrade soon and I only usually do light gaming on the desktop anyways (Dota 2) and thats about it. I mostly use it for torrents and watching movies on my TV.

Damn deepcool it’s so sad to see it die but you can’t have it all. I’m going to include it on the desktop set that I am selling (Intel E7400, 4gb corsair ram, Asus P5Q SE Plus, Coolermaster PSU and a broken 9800 GT) Hope someone buys it and I am going to use the money to buy WD NAS Reds.

RIP Deepcool