屏蔽雪球机器人

屏幕雪球上用户id为用户加数字的垃圾用户!

  1. // ==UserScript==
  2. // @name 屏蔽雪球机器人
  3. // @namespace cyqtest
  4. // @version 1.0
  5. // @description 屏幕雪球上用户id为用户加数字的垃圾用户!
  6. // @author devil
  7. // @match https://xueqiu.com/*
  8. // @icon https://assets.imedao.com/ugc/images/profiles/new/identity_icon_7-291fac8d46.png
  9. // @grant none
  10. // @run-at document-end
  11. // @license test
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. console.log("location.hostname:",location.hostname);
  17. let userInfo;
  18. if (document.domain == 'xueqiu.com'){
  19. //过滤雪球机器人用户
  20. setTimeout(() => {
  21. let ops =document.querySelector('.status-list');
  22. filter(ops);
  23. ops.addEventListener("DOMNodeInserted", function(event) {
  24. filter(ops)
  25. });
  26. }, 1000);
  27. };
  28.  
  29. function filter(root){
  30. let regEx = /用户(\d*)/g
  31. userInfo = root.querySelectorAll("article.timeline__item");
  32. for (var index=0;index<userInfo.length;index++){
  33. let userName = userInfo[index].getElementsByClassName("user-name")[0];
  34. let user_id = userName.innerText.match(regEx);
  35. if (user_id){
  36. userInfo[index].style.display = 'none';
  37. console.log('删除"' + user_id + '的帖子')
  38. }
  39. }
  40. }
  41. // Your code here...
  42. })();

QingJ © 2025

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