MetaFilter AI Post Hider

Completely hides posts containing AI/A.I. in title or body

目前為 2025-06-07 提交的版本,檢視 最新版本

// ==UserScript==
// @name         MetaFilter AI Post Hider
// @namespace    http://www.metafilter.com/
// @version      1.3
// @description  Completely hides posts containing AI/A.I. in title or body
// @match        https://www.metafilter.com/
// @grant        none
 // @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Find all post title + body pairs
    const titles = document.querySelectorAll('h2.posttitle');

    titles.forEach(title => {
        const postBody = title.nextElementSibling;

        // Skip if next element isn't a post body
        if (!postBody || !postBody.classList.contains('post')) return;

        // Combine title and body text
        const fullText = title.textContent + ' ' + postBody.textContent;

        // Match any variation of AI (with/without periods, case insensitive)
        if (/(^|\W)A\.?I\.?(\W|$)/i.test(fullText)) {
            // Hide both title and body
            title.style.display = 'none';
            postBody.style.display = 'none';
        }
    });
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。