虎扑帖子详情页屏蔽用户

在贴子里屏蔽某些人

  1. // ==UserScript==
  2. // @name 虎扑帖子详情页屏蔽用户
  3. // @namespace hupu.com
  4. // @version 0.3
  5. // @description 在贴子里屏蔽某些人
  6. // @author 仙圣
  7. // @match *://bbs.hupu.com/*
  8. // @icon none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. //屏蔽词列表。
  13. //屏蔽词的双引号为英文半角引号,逗号也是,请勿忘记加逗号。
  14. var blackList = [
  15. '和洗脑营销斗到底','成都人吊打北上光','Last成','玲珑心啊',
  16. ];
  17. function 屏蔽回复(){
  18. var target = document.querySelectorAll("div.post-reply-list_post-reply-list-wrapper__o4_81");
  19.  
  20. for (var i = 0;i < target.length; i++){
  21. if (target[i].querySelectorAll("a.post-reply-list-user-info-top-name")[0] != null){
  22. var node = target[i].querySelectorAll("a.post-reply-list-user-info-top-name")[0];
  23.  
  24. for (var j = 0 ;j < blackList.length; j++){
  25. //用户名在黑名单中则删掉
  26. if (node.innerHTML.indexOf(blackList[j]) > -1){
  27. target[i].remove();
  28. }
  29. }
  30. }
  31. }
  32. }
  33. function 屏蔽主贴(){
  34. var target2 = document.querySelectorAll("div.index_post-wrapper__IXkg_");
  35.  
  36. for (var i = 0;i < target2.length; i++){
  37. if (target2[i].querySelectorAll("a.post-user_post-user-comp-info-top-name__N3D4w")[0] != null){
  38. var node2 = target2[i].querySelectorAll("a.post-user_post-user-comp-info-top-name__N3D4w")[0];
  39.  
  40. for (var j = 0 ;j < blackList.length; j++){
  41. //用户名在黑名单中则删掉
  42. if (node2.innerHTML.indexOf(blackList[j]) > -1){
  43. target2[i].remove();
  44. }
  45. }
  46. }
  47. }
  48. }
  49. function 屏蔽查看评论里的回复(){
  50. var target3 = document.querySelectorAll("post-reply-detail-list_reply-detail-list__otjdd");
  51.  
  52. for (var i = 0;i < target3.length; i++){
  53. if (target3[i].querySelectorAll("a.preply-detail-list-user-info-top-name")[0] != null){
  54. var node3 = target3[i].querySelectorAll("a.reply-detail-list-user-info-top-name")[0];
  55.  
  56. for (var j = 0 ;j < blackList.length; j++){
  57. //用户名在黑名单中则删掉
  58. if (node3.innerHTML.indexOf(blackList[j]) > -1){
  59. target3[i].remove();
  60. }
  61. }
  62. }
  63. }
  64. }
  65.  
  66. setInterval(function(){屏蔽回复();}, 2000);
  67. setInterval(function(){屏蔽主贴();}, 2000);
  68. setInterval(function(){屏蔽查看评论里的回复();}, 2000);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址