// ==UserScript==
// @name filter
// @namespace 4chan
// @include http://dis.4chan.org/*
// ==/UserScript==
//version 1.11
textarearows=10;//text fields
textareacols=80;//text fields
hidePostField=0;//replace post field(read-only mode) with <hr>
hideInputName=1;//hide input fields in form
hideInputEmail=1;//hide input fields in form
hideNameField=1;// removes the display of names/emails
hideTripCode=1;//remove the tripcodes
hideDate=1;//remove the date data
nameFilter=/@|tdavis|n3n7i/ig //filter names and emails(with mailto:email)
tripFilter=/!iN.MY.aRMs|!THe.FamOus/ig
threadNameFilter=/nig+er|hur dur|(old|new)fag|your mother|vote up|\/(b|g)\/|ohgod|halp|masturbate|finally found|slashdoted|\/prob\/|russian supercomputer|i dont even|smoke \w+ everyday/ig;
minimumPostLength=20;//7 chars actually->add at least +13 padding.
//You should change the regexp filters for your personal preference
postfilter=/god say|losethos|check my dubfaggot|cock|dick|kill yourself|niggar|fuck you|1one1|autism|vibram|hdhairs|butt(| )sort|autist|(pretty|my) gay|mod this (thread|post)|check \'em |nikedunk|\sfart|ikeepall|click here|sexonline|sexy singles|single and horny|ur gay|faggot quotes|the jews|back to stackoverflow|my jizz|jesus will|bampu pantsu|\w+ anus[^\w]|[^\w]A(|[^\s\w\d])N(|[^\s\w\d])U(|[^\s\w\d])S|[^\w]desu desu[^\w]|m going to necro threads|Back to \/\w{1,7}\/|ur gay\n|\nlain(.|)\n|\nlisp\n|\nlol(\n| what)|\nmy homework is|army of 12 year old autistics|AIDS AND FAIL|(\n|\w+ )\d{1,12} get|Polecat(|s) Kebab(|s)|\n\d+\n|wholesale |\w+ weed|(\n| )(old|new)fag|\n(no|ok|yes|maybe)\n|ni(GG|g)er|AFRICAN AMERICAN|negro|jews|no exceptions|lol \w+\n|secret raid[^\w]|\nplease don't do that.|LOLOLOL|fail fail|fuck off|usingenglish.com|Use-English-Punctuation-Correctly|Back to the imageboards|Get the fuck out|ignore (posts|troll)|op is a fag|v8\.1c\.ru|fucknozzle|\nRead SICP\n|send this (\w+|\w+ \w+|\w+ \w+ \w+) to every|brofist|>get out<|>You fail it(.|)<|[^<]a href=|\[url=|runescape gold|MENA HASKAL|hax my \w+|\n(I|Y|W)HBT\n|\nIWNBT\n|HAXUS THE \w+\n/ig
threads2=document.getElementsByTagName('li');
for(i in threads2){if(threads2[i].innerHTML.search(threadNameFilter)!=-1){
threads2[i].setAttribute('style','display:none');}}
threads=document.getElementsByTagName('h2');
for(i in threads){if(threads[i].innerHTML.search(threadNameFilter)!=-1){
threads[i].parentNode.parentNode.setAttribute('style','display:none');}}
posts=document.getElementsByTagName('blockquote')
for(i in posts){
if(posts[i].innerHTML.length<minimumPostLength||posts[i].innerHTML.search(postfilter)!=-1){
posts[i].parentNode.setAttribute('style','display:none')}}
tripdata=document.getElementsByClassName('postertrip');
for(i in tripdata){if(tripdata[i].innerHTML.search(tripFilter)!=-1){
tripdata[i].parentNode.parentNode.parentNode.setAttribute('style','display:none');
}}
namedata=document.getElementsByClassName('postername');
for(i in namedata){if(namedata[i].innerHTML.search(nameFilter)!=-1){
namedata[i].parentNode.parentNode.parentNode.setAttribute('style','display:none');
}}
if(hideDate){//hides fake email too
badfield=document.getElementsByClassName('emailfield');
for(i in badfield){badfield[i].setAttribute('style','display:none');}
datedata=document.getElementsByClassName('posterdate');
for(i in datedata){datedata[i].setAttribute('style','display:none');}}
if(hideTripCode){
tripdata=document.getElementsByClassName('postertrip');
for(i in tripdata){tripdata[i].setAttribute('style','display:none');}}
if(hideNameField){
namedata=document.getElementsByClassName('postername');
namedata2=document.getElementsByClassName('namelabel');
for(i in namedata){namedata[i].setAttribute('style','display:none');}
for(i in namedata2){namedata2[i].setAttribute('style','display:none');}
}
if(hidePostField){
postforms=document.getElementsByTagName('form')
for(i in postforms){if (postforms[i].method=="post")postforms[i].innerHTML="<hr>"}
}
textf=document.getElementsByTagName('textarea')
for(i in textf){textf[i].cols=textareacols;textf[i].rows=textarearows;}
if(hideInputName||hideInputEmail){
k=document.getElementsByTagName('input')
if(hideInputName){for(i in k){if(k[i].name=="kotehan")k[i].setAttribute('style','display:none');}}
if(hideInputEmail){for(i in k){if(k[i].name=="meiru")k[i].setAttribute('style','display:none');}}
}