Guest User

Untitled

a guest
Jul 29th, 2020
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name Purger
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Purge unwanted posters
  6. // @author You
  7. // @match *://archive.nyafuu.org/meta/thread/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var unwanted = ['Fiery sword', 'Renz 中の人'];
  12.  
  13. function Delete () {
  14. var articles = [];
  15. var posts = document.getElementsByClassName('posts')[0]
  16. var Children = posts.children;
  17.  
  18. for (let item of Children) {
  19. if (!item.className.includes('stub stub')) {
  20. articles.push(item)
  21. }
  22. }
  23.  
  24. for (let i of articles) {
  25. var postName = i.querySelector('.post_wrapper header div .post_poster_data').innerText.trim()
  26. if (unwanted.includes(postName)) {
  27. i.remove()
  28. }
  29. }
  30. }
  31.  
  32. Delete()
  33. var observer = new MutationObserver(Delete)
  34. observer.observe(document.body, {
  35. childList: true,
  36. subtree: true,
  37. attributes: false,
  38. characterData: false,
  39. });
RAW Paste Data