Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name TrollBlock
- // @namespace MB
- // @description BlocksTrolls
- // @include *rerolled.org*
- // @version 1
- // ==/UserScript==
- (function ()
- {
- var trolls = new Array();
- trolls[0] = 'fanaskin';
- trolls[1] = 'General Antony';
- trolls[2] = 'TecKnoe';
- trolls[3] = 'Springbok';
- trolls[4] = 'B_Mizzle';
- trolls[5] = 'bleedat';
- var allPosts = document.evaluate("//li[@class='postbitlegacy postbitim postcontainer old']", document, null, XPathResult.ANY_TYPE, null );
- var posts = [];
- var post;
- while (post = allPosts.iterateNext())
- {
- posts.push( post );
- }
- if( posts.length > 0 )
- {
- //alert(posts.length);
- for( var i in posts )
- {
- //first check for a troll author
- post = posts[i];
- var author = post.getElementsByClassName('username_container')[0].getElementsByClassName('popupmenu memberaction')[0].firstChild.nextSibling.firstChild.firstChild.data;
- for( j = 0; j < trolls.length; j++ )
- {
- if( author == trolls[j] )
- {
- post.style.display = 'none';
- break;
- }
- }
- if( post.style.display != 'none' )
- {
- //now check for troll quoting
- var quotesHolder = document.evaluate(".//div[@class='bbcode_postedby']", post, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null );
- var quotes = [];
- var quote;
- while( quote = quotesHolder.iterateNext())
- {
- quotes.push(quote);
- }
- for( j = 0; j < quotes.length && post.style.display != 'none'; j++ )
- {
- quote = quotes[j];
- var quoteAuthor = quote.firstChild.nextSibling.nextSibling.nextSibling.firstChild.data;
- for( k = 0; k < trolls.length && post.style.display != 'none'; k++ )
- {
- if( quoteAuthor == trolls[k] )
- {
- post.style.display = 'none';
- break;
- }
- }
- }
- }
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement