CleanTwitterPosts

Auto-remove useless twitter replies with "@SaveToNotion"

  1. // ==UserScript==
  2. // @name CleanTwitterPosts
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.9
  5. // @author You
  6. // @description Auto-remove useless twitter replies with "@SaveToNotion"
  7. // @match https://twitter.com/*
  8. // @icon https://twitter.com/favicon.ico
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const BLOCKED_AT = ['@SaveToNotion']
  17.  
  18. const clean_once = () => {
  19. const posts = document.querySelectorAll('.css-1dbjc4n.r-1ila09b.r-qklmqi.r-1adg3ll.r-1ny4l3l')
  20. for(let i = 0 ; i < posts.length ; i++){
  21. const post = posts[i];
  22. const links = post.querySelectorAll('a')
  23. for(let j = 0 ; j < links.length ; j++){
  24. const text = links[j].text
  25. if(BLOCKED_AT.indexOf(text) !== -1){
  26. post.remove()
  27. break
  28. }
  29. }
  30. }
  31. }
  32. window.onload = () => {
  33. setInterval(clean_once, 3000)
  34. }
  35.  
  36. })();

QingJ © 2025

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