Twitter Custom Filter

Hide self-quoted tweets from specific users and remove specific tweets

  1. // ==UserScript==
  2. // @name Twitter Custom Filter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Hide self-quoted tweets from specific users and remove specific tweets
  6. // @author 24bit
  7. // @match https://x.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const users = ["4SCRF"];
  16. const keywords = ["curiouscat.live", "onvo.me", "curiouscat.me","codenames.game", "tellonym.me"];
  17. const bypassUser = "/s_9953";
  18.  
  19. const checkTweets = () => {
  20. const tweets = document.querySelectorAll('article, div[data-testid="cellInnerDiv"]');
  21.  
  22. tweets.forEach(tweet => {
  23. const tweetText = tweet.textContent;
  24. const tweetAuthorLink = tweet.querySelector('a[href]');
  25.  
  26. if (tweetAuthorLink && tweetAuthorLink.getAttribute('href') === bypassUser) {
  27. return;
  28. }
  29.  
  30. if (keywords.some(keyword => tweetText.includes(keyword)) ||
  31. users.some(user => (tweetText.match(new RegExp(`@${user}`, 'g')) || []).length > 1)) {
  32. tweet.style.display = 'none';
  33. }
  34. });
  35. };
  36.  
  37. // Check tweets when page is loaded
  38. checkTweets();
  39.  
  40. // Check new tweets every 5 milliseconds
  41. setInterval(checkTweets, 5);
  42. })();

QingJ © 2025

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