Advertisement
Guest User

rerolled trollblock

a guest
Jan 25th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. // ==UserScript==
  2. // @name TrollBlock
  3. // @namespace MB
  4. // @description BlocksTrolls
  5. // @include *rerolled.org*
  6. // @version 1
  7. // ==/UserScript==
  8.  
  9. (function ()
  10. {
  11. var trolls = new Array();
  12. trolls[0] = 'fanaskin';
  13. trolls[1] = 'General Antony';
  14. trolls[2] = 'TecKnoe';
  15. trolls[3] = 'Springbok';
  16. trolls[4] = 'B_Mizzle';
  17. trolls[5] = 'bleedat';
  18.  
  19.  
  20.  
  21. var allPosts = document.evaluate("//li[@class='postbitlegacy postbitim postcontainer old']", document, null, XPathResult.ANY_TYPE, null );
  22.  
  23. var posts = [];
  24. var post;
  25. while (post = allPosts.iterateNext())
  26. {
  27. posts.push( post );
  28. }
  29.  
  30.  
  31.  
  32. if( posts.length > 0 )
  33. {
  34. //alert(posts.length);
  35. for( var i in posts )
  36. {
  37. //first check for a troll author
  38. post = posts[i];
  39.  
  40. var author = post.getElementsByClassName('username_container')[0].getElementsByClassName('popupmenu memberaction')[0].firstChild.nextSibling.firstChild.firstChild.data;
  41.  
  42. for( j = 0; j < trolls.length; j++ )
  43. {
  44. if( author == trolls[j] )
  45. {
  46. post.style.display = 'none';
  47. break;
  48. }
  49. }
  50.  
  51.  
  52. if( post.style.display != 'none' )
  53. {
  54. //now check for troll quoting
  55. var quotesHolder = document.evaluate(".//div[@class='bbcode_postedby']", post, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null );
  56. var quotes = [];
  57. var quote;
  58. while( quote = quotesHolder.iterateNext())
  59. {
  60. quotes.push(quote);
  61. }
  62. for( j = 0; j < quotes.length && post.style.display != 'none'; j++ )
  63. {
  64. quote = quotes[j];
  65. var quoteAuthor = quote.firstChild.nextSibling.nextSibling.nextSibling.firstChild.data;
  66. for( k = 0; k < trolls.length && post.style.display != 'none'; k++ )
  67. {
  68. if( quoteAuthor == trolls[k] )
  69. {
  70. post.style.display = 'none';
  71. break;
  72. }
  73. }
  74. }
  75. }
  76. }
  77. }
  78.  
  79. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement