Guest User

Anime-sharing Hide User Posts

a guest
Mar 14th, 2022
1,450
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @author          Ryzen111
  3. // @name            Anime-Sharing Hide Posts
  4. // @description     Hide posts of other users
  5. // @include         http://www.anime-sharing.com/forum/hentai-games-38/*
  6. // @include         https://www.anime-sharing.com/forum/hentai-games-38/*
  7. // @include         http://www.anime-sharing.com/forum/miscellaneous-45/*
  8. // @include         https://www.anime-sharing.com/forum/miscellaneous-45/*
  9. // @include         https://www.anime-sharing.com/forum/torrents-47/*
  10. // @include         http://www.anime-sharing.com/forum/torrents-47/*
  11. // @version         1.0.0
  12. // ==/UserScript==
  13.  
  14. var pageHost = window.location.hostname;
  15. var all_links = "";
  16. var all_linksS = "";
  17.  
  18. if (pageHost == "www.anime-sharing.com"){
  19.     all_links = getElementsByXPath("//ol[@id='threads']/li[*]");
  20.     all_linksS = getElementsByXPath("//ol[@id='stickies']/li[*]");
  21. }
  22. //Normal Post
  23. for (var link = 0; link < all_links.length; link++) {
  24.     var node = all_links[link].innerText;
  25.     if (node.includes("USERYOUWANTTOHIDEPOST") ||
  26.        node.includes("USERYOUWANTTOHIDEPOST") ||
  27.        node.includes("USERYOUWANTTOHIDEPOST")){
  28.         all_links[link].style.display = "none";
  29.     }
  30. }
  31.  
  32. //Sticky Post
  33. for (var linkS = 0; linkS < all_linksS.length; linkS++) {
  34.     var nodeS = all_linksS[linkS].innerText;
  35.     if (nodeS.includes("USERYOUWANTTOHIDEPOST") ||
  36.         nodeS.includes("USERYOUWANTTOHIDEPOST") ||
  37.         nodeS.includes("USERYOUWANTTOHIDEPOST")){
  38.         all_linksS[linkS].style.display = "none";
  39.     }
  40. }
  41.  
  42. function getElementsByXPath(xpath, root){
  43.         var result = document.evaluate(xpath, root, null, 0, null);
  44.         var nodes = new Array();
  45.         i = 0;
  46.         while (node = result.iterateNext()) {
  47.             nodes[i] = node;
  48.             i++;
  49.         }
  50.         return nodes;
  51. }
RAW Paste Data Copied