A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

Nigga-be-gone

1.7k views · started by Awesomolocity ·
#1
Nigga-be-gone
Tired of cclown? Me too.
Below is userscript called "nigga-be-gone" (TM)
Removes his topics from the forums and removes his posts from threads. Because giving him attention is a nono.

Spoiler
// ==UserScript==
// @name nigga-be-gone
// @version 0.1.01
// @author Awesomolocity
// @description Man, fuck cclown
// @match http://www.logicalgamers.com/*
// ==/UserScript==

var cclown = [
'cclown23',
'owlcapone',
'do not add water'//,'rygaku'
];//Add more annoying people as needed

var users = document.getElementsByClassName('username'), i = 0, node, nodes = [];
for(i = 0;i<users.length;i++){
if(cclown.indexOf(users[i].innerText.toLowerCase()) != -1){//cclown up in here?
if(document.getElementById('posts')){//We in a thread?
if(users[i].parentNode.parentNode.parentNode.id.indexOf('post') != -1){//ignorelisted
nodes.push(users[i].parentNode.parentNode.parentNode);
}
else{
nodes.push(users[i].parentNode.parentNode.parentNode.parentNode.parentNode);
}
}
else if(users[i].parentNode.parentNode.className === 'author'){//We on a forum index page?
nodes.push(users[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode);
}
}
}
var i = 0;
while(i>-1){
i++;
}[/i][/i][/i][/i][/i][/i]


Can't figure out how to make your own damn userscript?
Click to install
#2
ty +rep
#3
if(!!document.getElementById('posts'))
if(document.getElementById('posts'))


i = nodes.length-1;
while(i>=0){
nodes.parentNode.removeChild(nodes);
i--;
}

for (i = nodes.length - 1; i >= 0; i--) nodes.parentNode.removeChild(nodes);
#4
GAMEchief wrote:
if(!!document.getElementById('posts'))
if(document.getElementById('posts'))


i = nodes.length-1;
while(i>=0){
nodes.parentNode.removeChild(nodes);
i--;
}

for (i = nodes.length - 1; i >= 0; i--) nodes.parentNode.removeChild(nodes);


While loop is faster, I'm 90% sure.
Granted, speed difference here wouldn't be a big deal, but...
#5
No. Your logic would make the for loop obsolete. In this day and age, it is optimized. It's about readability, not nanoseconds.
#6
GAMEchief wrote:
No. Your logic would make the for loop obsolete. In this day and age, it is optimized. It's about readability, not nanoseconds.


A while loop is readable.
#7
A while loop is readable.

It takes three times as many lines, and the operator is moved to the end of the loop, which is especially unreadable if the looped content is more than just a single line. Are you decreasing by 1 each iteration? 2? Dunno, would have to scroll to find out.
#8
Best userscript ever.
Ily.
#9
This doesn't work.
#10
what have i done to get listed on that xD
#11
rygaku wrote:
what have i done to get listed on that xD


Cclown23 Jr.
#13
.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode

lol
#14
mfw
var i = 0;
while(i>-1){
i++;
}
#15
Leave the poor OP alone! His username is Awesomolocity for god's sake. What did you guys expect, some godsend script?