Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const leftyTwats = ['theoldgreenfascist',
- 'DBC Reed',
- 'Liberal Yank',
- 'William Connolley',
- 'Don\'t Hug Me',
- 'Worstall\'s FAIL',
- 'Mister Bean',
- 'Heisenberg',
- 'mr ecks is a cock',
- 'Ecks is a fucking spastic',
- 'meiac',
- 'Jesus Christ',
- 'Newmania',
- 'Ice',
- 'Fatty',
- 'NiV',
- 't it',
- 'Steve.'];
- const antiSemiticTwats = ['Dave',
- 'Davedave',
- 'Paul Rain'
- ];
- const justTwats = ['Rickie'
- ];
- const islamicTwats = ['Ahmed Fares'
- ];
- function replaceDrivel (author, commentItem, twat, replace) {
- if (author.stringValue === twat) {
- const comment = document.evaluate (
- 'article[@class=\'comment\']/div[@class=\'comment-content\']',
- commentItem, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
- /* Should just be the one, but replace all just in case */
- for (let i = 0; i < comment.snapshotLength; i++) {
- comment.snapshotItem (i).innerHTML = `<p>${replace}</p>`;
- }
- }
- }
- const comments = document.evaluate(
- '//div[@id=\'comments\']/ol[@class=\'commentlist\']/li', document,
- null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
- for (let i = 0; i < comments.snapshotLength; i++) {
- const commentItem = comments.snapshotItem (i);
- const author = document.evaluate(
- 'article[@class=\'comment\']/footer/div[contains(@class, \'comment-author\')]/cite[@class=\'fn\']/descendant::text()',
- commentItem, null, XPathResult.STRING_TYPE, null);
- [...leftyTwats, ...justTwats].forEach (twat => replaceDrivel (author, commentItem, twat, 'Usual twattish drivel'));
- antiSemiticTwats.forEach (twat => replaceDrivel (author, commentItem, twat, 'Usual anti-semitic drivel'));
- islamicTwats.forEach (twat => replaceDrivel (author, commentItem, twat, 'Usual terrorist supporting drivel'));
- }
Add Comment
Please, Sign In to add comment