Bulk unfollow spam 'following'-s in Twitter (just for the record)

Feb 19, 2014 19:30

Go to your Twitter using Chrome Browser and open your 'Following' section.
Let's say you have 430 followings and only 10 of them was made by yourself.
Usually, those 10 will be at very bottom of the list on this page, except the case when you've added somebody during last couple of days.
Copy and paste such nicknames somewhere in notepad, you may add them later again.

1) Hence, you have to get rid of 420 spammers. What you need is
Scroll to very end of the page and proceed scrolling until page stops to populate the list and you see those 10 your real friends.
At this stage the main goal is to get all followings to be shown on the page. This will make us able to do it in a one hook.

2) Open Chrome's Console (Ctrl+Shift+C in Windows) and paste there following and then press Enter:

function simulate(element, eventName)
{
var options = extend(defaultOptions, arguments[2] || {});
var oEvent, eventType = null;

for (var name in eventMatchers)
{
if (eventMatchers[name].test(eventName)) { eventType = name; break; }
}

if (!eventType)
throw new SyntaxError('Only HTMLEvents and MouseEvents interfaces are supported');

if (document.createEvent)
{
oEvent = document.createEvent(eventType);
if (eventType == 'HTMLEvents')
{
oEvent.initEvent(eventName, options.bubbles, options.cancelable);
}
else
{
oEvent.initMouseEvent(eventName, options.bubbles, options.cancelable, document.defaultView,
options.button, options.pointerX, options.pointerY, options.pointerX, options.pointerY,
options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, element);
}
element.dispatchEvent(oEvent);
}
else
{
options.clientX = options.pointerX;
options.clientY = options.pointerY;
var evt = document.createEventObject();
oEvent = extend(evt, options);
element.fireEvent('on' + eventName, oEvent);
}
return element;
}

function extend(destination, source) {
for (var property in source)
destination[property] = source[property];
return destination;
}

var eventMatchers = {
'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
'MouseEvents': /^(?:click|dblclick|mouse(?:down|up|over|move|out))$/
}
var defaultOptions = {
pointerX: 0,
pointerY: 0,
button: 0,
ctrlKey: false,
altKey: false,
shiftKey: false,
metaKey: false,
bubbles: true,
cancelable: true
}

}

(you may see 'undefined' press Enter, just ignore that)

3) Then copy and paste the following and press Enter

t=document.getElementById('timeline').getElementsByClassName('user-actions-follow-button js-follow-btn follow-button btn');

4) Now the main thing, which will remove all spammers. As far as we decided that you have 10 real friends which we want to keep in you Followings then substitute this number in expression within (..) after 'if' like this (t.length-1-10) in following lines below. Copy and paste it into Chrome's console and put your number.

for (var i in t){
if (i

To ensure reload the page to see that number of Followings reduced to a normal.

P.S. it will work until twitter change their markup of this page. Worked for me at Feb 2014

spammers, spam followings in twitter, spam, spam followings, remove spam followings, twitter, reminder, twitter spam, javascript

Previous post Next post
Up