clear all posts that want help

hide posts with help and question flairs does not work with old reddit

  1. // ==UserScript==
  2. // @name clear all posts that want help
  3. // @description hide posts with help and question flairs does not work with old reddit
  4. // @version 1.0
  5. // @namespace clear help and question posts on r/robloxhackers
  6. // @license MIT
  7. // @author M-r7z
  8. // @match https://www.reddit.com/r/robloxhackers/*
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. function hide() {
  14. const posts = document.querySelectorAll('shreddit-post');
  15.  
  16. posts.forEach(post => {
  17. const flair = post.querySelector('shreddit-post-flair .flair-content');
  18. if (flair && (flair.textContent.includes("HELP") || flair.textContent.includes("QUESTION"))) {
  19. post.style.display = 'none';
  20. }
  21. });
  22. }
  23.  
  24. hide();
  25.  
  26. const observer = new MutationObserver(hide);
  27. observer.observe(document.body, { childList: true, subtree: true });
  28. })();