TorrentBD Shoutbox Cleaner

Improve the shoutbox by filtering out unrelated entries such as 'New Torrent', 'New Forum Post', thus refining the user experience to ensure relevance.

// ==UserScript==
// @name         TorrentBD Shoutbox Cleaner
// @icon         https://www.google.com/s2/favicons?sz=64&domain=torrentbd.net
// @namespace    adtitas
// @version      1.0.0
// @description  Improve the shoutbox by filtering out unrelated entries such as 'New Torrent', 'New Forum Post', thus refining the user experience to ensure relevance.
// @match        https://*.torrentbd.com/*
// @match        https://*.torrentbd.net/*
// @match        https://*.torrentbd.org/*
// @match        https://*.torrentbd.me/*
// @grant        none
// @author       adtitas
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function checkShoutbox() {
        let shoutItems = document.querySelectorAll('.shout-item');
        shoutItems.forEach((item) => {
            let textField = item.querySelector('.shout-text');
            let shoutHTML = textField.innerHTML;
            if (shoutHTML.includes('<font color="#cc0036">New Torrent :</font>') ||
                shoutHTML.includes('<font color="#00a884">New Forum Post </font>') ||
                shoutHTML.includes('<font color="#00a884">New Forum Topic</font>') ||
                shoutHTML.includes('<font color="#1976d2">New Request :</font>')) {
                item.remove();
            }
        });
    }

    checkShoutbox();

    let observer = new MutationObserver(checkShoutbox);
    let shoutContainer = document.querySelector('#shouts-container');
    observer.observe(shoutContainer, { childList: true });
})();