Writing a greasemonkey script to block this unicode shit spam. Can I use regex with unicode? I have almost no experience with uni, any help would be appreciated.
Name:
Anonymous2012-05-30 21:44
OP here, did a little google work. Apparently the situation with unicode, regex amd JS suck. Should I take this route?
function containsNonLatinCodepoints(s) {
return /[^\\u0000-\\u00ff]/.test(s);
}
OP HERE. I had already found some other /prog/lodites filter for /sci/ shitposters. Heres what I did
// ==UserScript==
// @name fix unishit
// @namespace http://dis.4chan.org/prog/
// @description fixes the unicode shitposts
// @include http://dis.4chan.org/*;;
// ==/UserScript==
(function(){
var posts = [];
var myclass = new RegExp('\\bpost\\b');
var divs = document.getElementsByTagName('div')
var gayness = /[^\\u0000-\\u00ff]/;
for(var i = 0; i < divs.length; ++i){
var classes = divs[i].className;
if(myclass.test(classes)) posts.push(divs[i]);
}
for(var i = 0; i < posts.length; ++i){
var postername = posts[i].getElementsByTagName('span')[3];
var postertrip = posts[i].getElementsByTagName('span')[4];
var postbody = posts[i].getElementsByTagName('blockquote')[0];
if(gayness.test(postbody.textContent))
posts[i].parentNode.removeChild(posts[i]);
}
}());
Name:
Anonymous2012-05-31 0:34
Op here, did it the way I proposed in >>2 because i didn't see >>5
sans reply. Works fine except I cant see >>2 because I said /[^\\u0000-\\u00ff]/
Name:
Anonymous2012-05-31 1:27
Also wanna thank /prog/ for trying to help!
Name:
Anonymous2012-05-31 2:23
Op again. Why does the board even allow unicode shit through?
Name:
Anonymous2012-05-31 3:13
check em
Name:
Anonymous2012-05-31 3:30
>>10
because we're not all english speaking faggots
>>22
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
dubs won this time
>>25
Obviously it means humans cant handle freedom and jews are right.
Name:
Anonymous2012-06-01 1:20
This is why government exists.
Name:
Anonymous2012-06-01 2:36
>>25
I was just asking about the situation, not stating a position.
Name:
Anonymous2013-08-31 7:23
It was about Hikikomori as long as Misaki didn't show up.
Name:
Anonymous2013-08-31 8:07
I remember reading and watching a documentary about Project Orion a few years ago, and it really amazed me how close they came to launching a manned rocket to Saturn. If anyone doesn't know what Orion is, see: http://en.wikipedia.org/wiki/Project_Orion_%28nuclear_propulsion%29
Name:
Anonymous2013-08-31 8:53
Hey. I'm an american and i want to get news. I know CNN and FOX and all the crap that american's typicaly get is biased garbage. I dont trust BBC that much. What are some realiable new sources that i can look too.