FrostCloud Forums  

Go Back   FrostCloud Forums > Blogs > The Emu's Roost

Greetings!

Philosophy, computers, plumage.
Rate this Entry

I'm in ur toobz, hidin' ur spam.

Posted 10-24-2008 at 03:39 PM by Dromiceius
I know I'm hardly the only person who hates Youtube comments. I am, however, the first person I know of to implement the particular solution I wanted to try.

I wrote a GreaseMonkey script, mainly to see how well I could isolate the signal from the noise. My method was to filter out internet-isms, lol-speak, and a few words that tend to occur in e-penis duels.


The code itself isn't complicated. It matches every comment against a bunch of regular expressions, and hides the comment when it finds a match...

Edit: After more experimentation, I'm finding that it worked better before I fixed all the false positives in the regexes.

I think a simple random filter would improve things. Maybe by judging "bogosity" as a function of comment length and any evidence signifying a basic understanding of English.

I'm aware of a Firefox addon called "Youtube Snob" which seems to do a subset of my filters, and which is a pain in the ass to extend. Obviously, I don't care about that.

Code:
/* ==UserScript==
 @name          Youtube Comment Sanitizer
 @include       http://www.youtube.com/watch*
 @description   Filters out the incoherent, leaving the almost-coherent.
 ==/UserScript==*/

var pileoshit = [/L+O+L/i, /than[kx]/i, /thx/i, /[!\?][!\?][!\?]+/, /z*om.g/i, /ro[l|f]/i, /[^a-z]ty/i, /fu+ck/i, /shit/i, /wtf/i, /wo+t/i, /lmf*ao/i, /stfu/i, /[\<]+[\3]/i, /teh/i, /:[pPdD\)]/, /ga[yi]/i, /x[dp]/i, /[ \t][\?]/i, /[ \t]r[ \t]/i, /[op]wn[z|ed]*/i, /jap[ \t|s]/i, /p[r|o|0]+n/i, /epic/i, /fail/i, /boob/i, /fap/i, /nuff/i, /\^\^/i, /[\.\t]COM/i];

// /cunt/, /jew/, /fag/, /nigger/, /queer/, /homo/ //matches too seldom, surprisingly
// /^[^A-Z]/, /.*[^\.]$/, /[\.]+[a-zA-Z]/, //always matches

(function() {
	var comments = document.getElementsByTagName('DIV');
	if(comments.length < 1) return;

	for(i = 0; i < comments.length; i++) {
		var match = 0;
		for(j = 0; j < pileoshit.length; j++) {
			if((comments[i].className=='watch-comment-body') && comments[i].innerHTML.match(pileoshit[j])) {
				  comments[i].parentNode.style.display='none';
				  match = 1;
                                  break;
			}
		}
		if(match) continue;
	}
})();
Posted in Computers
Comments 1 Email Blog Entry
Total Comments 1

Comments

Old
Ben Burkhill's Avatar
LOL dude.
Posted 10-26-2008 at 02:04 AM by Ben Burkhill Ben Burkhill is offline
 
Recent Blog Entries by Dromiceius

All times are GMT +1. The time now is 09:21 AM.



Powered by: vBulletin
Copyright 2000-2008 Jelsoft Enterprises Limited
Hosted and Maintained by The IceStorm Network