Guest User

arsewipe.js

a guest
Feb 28th, 2020
37
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. const leftyTwats = ['theoldgreenfascist',
  3.                     'DBC Reed',
  4.             'Liberal Yank',
  5.                     'William Connolley',
  6.                     'Don\'t Hug Me',
  7.                     'Worstall\'s FAIL',
  8.                     'Mister Bean',
  9.                     'Heisenberg',
  10.                     'mr ecks is a cock',
  11.                     'Ecks is a fucking spastic',
  12.                     'meiac',
  13.                     'Jesus Christ',
  14.                     'Newmania',
  15.                     'Ice',
  16.                     'Fatty',
  17.                     'NiV',
  18.                     't it',
  19.                     'Steve.'];
  20. const antiSemiticTwats = ['Dave',
  21.                           'Davedave',
  22.                           'Paul Rain'
  23.                          ];
  24. const justTwats = ['Rickie'
  25.                   ];
  26. const islamicTwats = ['Ahmed Fares'
  27.                      ];
  28.  
  29. function replaceDrivel (author, commentItem, twat, replace) {
  30.   if (author.stringValue === twat) {
  31.     const comment = document.evaluate (
  32.       'article[@class=\'comment\']/div[@class=\'comment-content\']',
  33.       commentItem, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  34.  
  35.     /* Should just be the one, but replace all just in case */
  36.     for (let i = 0; i < comment.snapshotLength; i++) {
  37.       comment.snapshotItem (i).innerHTML = `<p>${replace}</p>`;
  38.     }
  39.   }
  40. }
  41.  
  42. const comments = document.evaluate(
  43.   '//div[@id=\'comments\']/ol[@class=\'commentlist\']/li', document,
  44.   null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  45.  
  46. for (let i = 0; i < comments.snapshotLength; i++) {
  47.   const commentItem = comments.snapshotItem (i);
  48.   const author = document.evaluate(
  49.     'article[@class=\'comment\']/footer/div[contains(@class, \'comment-author\')]/cite[@class=\'fn\']/descendant::text()',
  50.     commentItem, null, XPathResult.STRING_TYPE, null);
  51.  
  52.   [...leftyTwats, ...justTwats].forEach (twat => replaceDrivel (author, commentItem, twat, 'Usual twattish drivel'));
  53.   antiSemiticTwats.forEach (twat => replaceDrivel (author, commentItem, twat, 'Usual anti-semitic drivel'));
  54.   islamicTwats.forEach (twat => replaceDrivel (author, commentItem, twat, 'Usual terrorist supporting drivel'));
  55. }
RAW Paste Data