💊 NodeSeek “降压药”插件:净化视界 (自动同步官方屏蔽版)

🤯 创作初衷:为了我的乳腺/前列腺健康
是不是每天打开论坛,心情本来挺好,结果刷到第 3 个“打卡注册甲骨文(总是浪费我们10分钟时间)”的时候眉头开始紧锁?刷到第 10 个“溢价3000出xxx”的时候血压开始升高?

又或者,总有那么一两个 ID,不管什么帖子下面都有他,杠得你头皮发麻,看着心烦,不看又关不掉?

为了大家的身心健康,为了让论坛回归清净,这款插件诞生了! 它的核心哲学只有一个:眼不见为净,看见喜欢的要高亮!


🛠️ 它能干什么?(功能太强,低调使用)

1. 🚫 “灭霸响指”模式(屏蔽功能)

  • UID 精准核打击:有些讨人厌的家伙喜欢改名?没用!本插件直接锁定他的 UID(身份证号)。只要进了你的黑名单,他就算改名叫“吴彦祖”也得在你的页面上消失。
  • 关键词地图炮:不想看“出机”?不想看“回血”?不想看某个特定商家的名字?
    • 支持普通关键词(比如 baidu),大小写通杀。
    • 支持 正则表达式(高端玩家专用),想屏蔽所有“【.*】”开头的标题?一行代码教做人。

2. “大佬请喝茶”模式(高亮关注)

  • 老婆/大佬专属色:怕错过了技术大佬的干货?还是怕错过了富哥的 T楼抽奖
    • 把他们的 UID 扔进关注列表,直接给他上个 “土豪金” 或 “猛男粉” 的颜色。
    • 在一堆黑白灰的帖子里,你关注的人就像黑夜里的萤火虫,那么鲜明,那么出众。

🎨 傻瓜式 UI,比某微还要好用

  • 拖拽窗口:设置面板挡住你看帖了?按住标题栏,随便拖! 想扔哪就扔哪。

  • 原生调色板:不想手动输色号?直接点击色块弹出调色板,想要什么五彩斑斓的黑,自己选。

  • 不分大小写:Baidu、BAIDU、baidu... 无论商家怎么变着花样写,插件统一按小写处理,一个都跑不掉。


🧐 为什么你需要它?

  • 因为你的时间很值钱:不要浪费生命在划过那 99% 的重复内容上。

  • 因为你的心情很重要:把那些“杠精”和“复读机”关进小黑屋,世界瞬间清静了。

  • 因为你不想错过福利:第一时间发现大佬的帖子,抢沙发、中大奖,快人一步。

👇 立即安装
别犹豫了,装上它,让你的 NodeSeek 变成真正属于你的 “NodeSeek Pro Max Ultra” 版!


(P.S. 本插件纯本地运行,你的屏蔽列表只有天知地知你知插件知,请放心食用。)



// ==UserScript==
// @name         NodeSeek 超级增强:帖子与评论屏蔽
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  全站净化:支持屏蔽帖子标题、帖子作者、评论内容、评论作者。支持拖拽面板、调色板、多行输入。
// @author       Gemini&NodeSeek:@xiaoyang
// @match        https://www.nodeseek.com/*
// @grant        GM_setValue
// @grant        GM_getValue
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // --- 初始化配置 ---
    let config = GM_getValue('ns_enhanced_config', {
        block: { uids: [], keys: [] },
        follow: { uids: [], keys: [] },
        style: { titleColor: '#ff0000', bgColor: '#fff9db' }
    });

    const parseInput = (text) => text.split(/[,
]/).map(s => s.trim()).filter(s => s.length > 0);

    // --- 核心匹配逻辑 ---
    const checkMatch = (text, uid, targetConfig) => {
        // 1. 检查 UID
        if (uid && targetConfig.uids.includes(uid)) return true;

        // 2. 检查文本内容 (标题或评论)
        if (!text) return false;
        const lowerText = text.toLowerCase();

        return targetConfig.keys.some(pattern => {
            try {
                // 正则匹配
                if (pattern.startsWith('/') && pattern.lastIndexOf('/') > 0) {
                    const lastSlash = pattern.lastIndexOf('/');
                    const reg = new RegExp(pattern.substring(1, lastSlash), pattern.substring(lastSlash   1)   'i');
                    return reg.test(text);
                }
                // 普通字符串匹配
                return lowerText.includes(pattern.toLowerCase());
            } catch (e) {
                return lowerText.includes(pattern.toLowerCase());
            }
        });
    };

    const applyLogic = () => {
        const posts = document.querySelectorAll('.post-list-item');
        posts.forEach(item => {
            const userLink = item.querySelector('.info-author a');
            const titleLink = item.querySelector('.post-title a');
            if (!userLink || !titleLink) return;

            const uidMatch = userLink.getAttribute('href').match(/\/space\/(\d )/);
            const uid = uidMatch ? uidMatch[1] : null;
            const titleText = titleLink.textContent.trim();

            // 帖子屏蔽
            if (checkMatch(titleText, uid, config.block)) {
                item.style.setProperty('display', 'none', 'important');
                return;
            } else {
                item.style.display = '';
            }

            // 帖子高亮
            if (checkMatch(titleText, uid, config.follow)) {
                item.style.setProperty('background-color', config.style.bgColor, 'important');
                titleLink.style.setProperty('color', config.style.titleColor, 'important');
                titleLink.style.setProperty('font-weight', 'bold', 'important');
            } else {
                item.style.backgroundColor = '';
                titleLink.style.color = '';
                titleLink.style.fontWeight = '';
            }
        });

        const comments = document.querySelectorAll('li.content-item');
        comments.forEach(item => {
            // 避免重复处理或处理已隐藏的
            // if (item.dataset.processed === 'true') return;

            const authorLink = item.querySelector('.author-name');
            const contentEl = item.querySelector('.post-content');

            if (!authorLink) return;

            const uidMatch = authorLink.getAttribute('href').match(/\/space\/(\d )/);
            const uid = uidMatch ? uidMatch[1] : null;
            const contentText = contentEl ? contentEl.textContent.trim() : "";

            // 评论屏蔽
            if (checkMatch(contentText, uid, config.block)) {
                item.style.setProperty('display', 'none', 'important');
                return;
            } else {
                item.style.display = '';
            }

            // 评论高亮
            if (checkMatch(contentText, uid, config.follow)) {
                item.style.setProperty('background-color', config.style.bgColor, 'important');
                // 评论区没有标题,我们将用户名染成“标题色”以示区分
                authorLink.style.setProperty('color', config.style.titleColor, 'important');
                authorLink.style.setProperty('font-weight', 'bold', 'important');
            } else {
                item.style.backgroundColor = '';
                authorLink.style.color = '';
                authorLink.style.fontWeight = '';
            }
        });
    };

    // --- UI 构建 ---
    const createUI = () => {
        if (document.getElementById('ns-config-btn')) return;

        const btn = document.createElement('div');
        btn.id = 'ns-config-btn';
        btn.innerHTML = '⚙️ 插件设置';
        Object.assign(btn.style, {
            position: 'fixed', bottom: '80px', right: '20px', zIndex: '9999',
            padding: '8px 15px', backgroundColor: '#333', color: 'white',
            borderRadius: '20px', cursor: 'pointer', fontSize: '12px', boxShadow: '0 2px 8px rgba(0,0,0,0.3)'
        });
        document.body.appendChild(btn);

        const panel = document.createElement('div');
        panel.id = 'ns-config-panel';
        Object.assign(panel.style, {
            display: 'none', position: 'fixed', top: '20%', left: '35%',
            width: '400px', backgroundColor: '#fff', borderRadius: '12px',
            boxShadow: '0 10px 40px rgba(0,0,0,0.2)', zIndex: '10000',
            fontFamily: 'sans-serif', overflow: 'hidden'
        });

        const areaStyle = "width:100%; min-height:100px; margin:5px 0; border:1px solid #ddd; border-radius:4px; padding:8px; font-size:13px; resize:vertical; box-sizing:border-box; background:#fff;";
        const labelHint = '(帖子 & 评论通用)';

        panel.innerHTML = `
            
NodeSeek 全站净化 ×
屏蔽列表
关注高亮
外观设置

以下设置仅对“关注列表”匹配到的内容生效:

文字颜色: (关注贴标题 / 关注评论者ID)
背景颜色: (行背景色)
`; document.body.appendChild(panel); const tabs = document.querySelectorAll('.ns-tab'); tabs.forEach(tab => { tab.onclick = () => { const target = tab.getAttribute('data-tab'); const contents = document.querySelectorAll('.ns-tab-content'); contents.forEach(content => { content.style.display = 'none'; }); const targetEl = document.getElementById('tab-' target); if (targetEl) { targetEl.style.display = 'block'; } tabs.forEach(t => { t.style.color = '#666'; t.style.borderBottom = 'none'; t.style.fontWeight = 'normal'; }); tab.style.color = (target === 'block' ? '#d93025' : (target === 'follow' ? '#188038' : '#1a73e8')); tab.style.borderBottom = `2px solid ${tab.style.color}`; tab.style.fontWeight = 'bold'; }; }); // 拖拽 const handle = document.getElementById('ns-drag-handle'); let isDragging = false, offset = [0, 0]; handle.onmousedown = (e) => { isDragging = true; offset = [panel.offsetLeft - e.clientX, panel.offsetTop - e.clientY]; }; document.onmousemove = (e) => { if (!isDragging) return; panel.style.left = (e.clientX offset[0]) 'px'; panel.style.top = (e.clientY offset[1]) 'px'; }; document.onmouseup = () => { isDragging = false; }; // 事件绑定 btn.onclick = () => { panel.style.display = 'block'; }; document.getElementById('ns-close-x').onclick = () => { panel.style.display = 'none'; }; document.getElementById('ns-save').onclick = () => { config = { block: { uids: parseInput(document.getElementById('in-b-uids').value), keys: parseInput(document.getElementById('in-b-keys').value) }, follow: { uids: parseInput(document.getElementById('in-f-uids').value), keys: parseInput(document.getElementById('in-f-keys').value) }, style: { titleColor: document.getElementById('in-s-tc').value, bgColor: document.getElementById('in-s-bg').value } }; GM_setValue('ns_enhanced_config', config); applyLogic(); panel.style.display = 'none'; }; }; createUI(); applyLogic(); // 监听全站动态加载 new MutationObserver(applyLogic).observe(document.body, { childList: true, subtree: true }); })();

NodeSeek 增强插件 V2.0 (自动同步官方屏蔽版)

"懒同步"策略 (Lazy Sync)

无需额外爬虫:利用浏览过程自动补全。

避免重复提交:基于官方列表缓存进行过滤。

零误杀:直接使用页面上显示的用户名,准确无误。

// ==UserScript==
// @name         NodeSeek 超级增强:全站屏蔽与同步助手
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  全站屏蔽(标题/评论/UID),支持自动同步屏蔽名单到官方系统,支持拖拽面板与调色板
// @author       Gemini&NodeSeek:@xiaoyang
// @match        https://www.nodeseek.com/*
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_xmlhttpRequest
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // --- 初始化配置 ---
    let config = GM_getValue('ns_enhanced_config', {
        block: { uids: [], keys: [] },
        follow: { uids: [], keys: [] },
        style: { titleColor: '#ff0000', bgColor: '#fff9db' },
        settings: { syncToOfficial: false } // 新增:同步开关
    });

    // 内存缓存:存储官方已屏蔽的 UID Set
    let officialBlockSet = new Set();
    let isOfficialListLoaded = false;

    const parseInput = (text) => text.split(/[,
]/).map(s => s.trim()).filter(s => s.length > 0);

    // --- API 交互模块 ---
    const API = {
        // 获取官方屏蔽列表
        fetchOfficialList: () => {
            fetch('/api/block-list/list')
                .then(res => res.json())
                .then(json => {
                    if (json.success && Array.isArray(json.data)) {
                        officialBlockSet.clear();
                        json.data.forEach(user => {
                            officialBlockSet.add(String(user.block_member_id));
                        });
                        isOfficialListLoaded = true;
                        console.log('[NS增强] 已加载官方屏蔽列表,数量:', officialBlockSet.size);
                    }
                })
                .catch(err => console.error('[NS增强] 获取官方列表失败', err));
        },

        // 添加到官方屏蔽列表
        addToOfficial: (username, uid) => {
            // 防御:如果没有开启同步,或者还没加载完官方列表,或者已经存在于官方列表,则不执行
            if (!config.settings.syncToOfficial || !isOfficialListLoaded || officialBlockSet.has(String(uid))) {
                return;
            }

            console.log(`[NS增强] 正在将用户 ${username}(UID:${uid}) 同步至官方屏蔽列表...`);

            fetch('/api/block-list/add', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({ block_member_name: username })
            })
            .then(res => res.json())
            .then(json => {
                if (json.success) {
                    officialBlockSet.add(String(uid)); // 更新本地缓存,防止重复提交
                    // 可以在页面上给个轻提示,这里仅控制台输出
                    console.log(`[NS增强] 同步成功: ${username}`);
                } else {
                    console.warn(`[NS增强] 同步失败: ${json.message}`);
                }
            })
            .catch(err => console.error('[NS增强] 请求错误', err));
        }
    };

    // --- 核心匹配逻辑 ---
    const checkMatch = (text, uid, targetConfig) => {
        if (uid && targetConfig.uids.includes(uid)) return true;
        if (!text) return false;
        const lowerText = text.toLowerCase();

        return targetConfig.keys.some(pattern => {
            try {
                if (pattern.startsWith('/') && pattern.lastIndexOf('/') > 0) {
                    const lastSlash = pattern.lastIndexOf('/');
                    const reg = new RegExp(pattern.substring(1, lastSlash), pattern.substring(lastSlash   1)   'i');
                    return reg.test(text);
                }
                return lowerText.includes(pattern.toLowerCase());
            } catch (e) {
                return lowerText.includes(pattern.toLowerCase());
            }
        });
    };

    const applyLogic = () => {
        // 1. 处理帖子列表
        const posts = document.querySelectorAll('.post-list-item');
        posts.forEach(item => {
            const userLink = item.querySelector('.info-author a');
            const titleLink = item.querySelector('.post-title a');
            if (!userLink || !titleLink) return;

            const uidMatch = userLink.getAttribute('href').match(/\/space\/(\d )/);
            const uid = uidMatch ? uidMatch[1] : null;
            const username = userLink.textContent.trim(); // 获取用户名
            const titleText = titleLink.textContent.trim();

            // 屏蔽逻辑
            if (checkMatch(titleText, uid, config.block)) {
                item.style.setProperty('display', 'none', 'important');

                // --- 自动同步逻辑触发点 ---
                // 如果是因为 UID 匹配而被屏蔽,且开启了同步,则尝试同步
                if (uid && config.block.uids.includes(uid)) {
                    API.addToOfficial(username, uid);
                }
                return;
            } else {
                item.style.display = '';
            }

            // 高亮逻辑
            if (checkMatch(titleText, uid, config.follow)) {
                item.style.setProperty('background-color', config.style.bgColor, 'important');
                titleLink.style.setProperty('color', config.style.titleColor, 'important');
                titleLink.style.setProperty('font-weight', 'bold', 'important');
            } else {
                item.style.backgroundColor = '';
                titleLink.style.color = '';
                titleLink.style.fontWeight = '';
            }
        });

        // 2. 处理评论列表
        const comments = document.querySelectorAll('li.content-item');
        comments.forEach(item => {
            const authorLink = item.querySelector('.author-name');
            const contentEl = item.querySelector('.post-content');
            if (!authorLink) return;

            const uidMatch = authorLink.getAttribute('href').match(/\/space\/(\d )/);
            const uid = uidMatch ? uidMatch[1] : null;
            const username = authorLink.textContent.trim(); // 获取用户名
            const contentText = contentEl ? contentEl.textContent.trim() : "";

            // 屏蔽逻辑
            if (checkMatch(contentText, uid, config.block)) {
                item.style.setProperty('display', 'none', 'important');

                // --- 自动同步逻辑触发点 ---
                if (uid && config.block.uids.includes(uid)) {
                    API.addToOfficial(username, uid);
                }
                return;
            } else {
                item.style.display = '';
            }

            // 高亮逻辑
            if (checkMatch(contentText, uid, config.follow)) {
                item.style.setProperty('background-color', config.style.bgColor, 'important');
                authorLink.style.setProperty('color', config.style.titleColor, 'important');
                authorLink.style.setProperty('font-weight', 'bold', 'important');
            } else {
                item.style.backgroundColor = '';
                authorLink.style.color = '';
                authorLink.style.fontWeight = '';
            }
        });
    };

    // --- UI 构建 ---
    const createUI = () => {
        if (document.getElementById('ns-config-btn')) return;

        const btn = document.createElement('div');
        btn.id = 'ns-config-btn';
        btn.innerHTML = '⚙️ 插件设置';
        Object.assign(btn.style, {
            position: 'fixed', bottom: '80px', right: '20px', zIndex: '9999',
            padding: '8px 15px', backgroundColor: '#333', color: 'white',
            borderRadius: '20px', cursor: 'pointer', fontSize: '12px', boxShadow: '0 2px 8px rgba(0,0,0,0.3)'
        });
        document.body.appendChild(btn);

        const panel = document.createElement('div');
        panel.id = 'ns-config-panel';
        Object.assign(panel.style, {
            display: 'none', position: 'fixed', top: '20%', left: '35%',
            width: '400px', backgroundColor: '#fff', borderRadius: '12px',
            boxShadow: '0 10px 40px rgba(0,0,0,0.2)', zIndex: '10000',
            fontFamily: 'sans-serif', overflow: 'hidden'
        });

        const areaStyle = "width:100%; min-height:80px; margin:5px 0; border:1px solid #ddd; border-radius:4px; padding:8px; font-size:13px; resize:vertical; box-sizing:border-box; background:#fff;";
        const labelHint = '(帖子 & 评论通用)';

        // 判断当前开关状态
        const syncChecked = config.settings && config.settings.syncToOfficial ? 'checked' : '';

        panel.innerHTML = `
            
NodeSeek 全站净化 ×
屏蔽列表
关注高亮
设置

开启后,当您浏览到被插件屏蔽的 UID 用户时,插件会自动获取其用户名并将其添加到 NodeSeek 官方屏蔽列表中。
*自动检测已存在名单,不会重复请求。

文字颜色:
背景颜色:
`; document.body.appendChild(panel); const tabs = document.querySelectorAll('.ns-tab'); tabs.forEach(tab => { tab.onclick = () => { const target = tab.getAttribute('data-tab'); const contents = document.querySelectorAll('.ns-tab-content'); contents.forEach(c => {c.style.display = 'none'}); const targetEl = document.getElementById('tab-' target); if(targetEl) targetEl.style.display = 'block'; tabs.forEach(t => { t.style.color = '#666'; t.style.borderBottom = 'none'; t.style.fontWeight = 'normal'; }); tab.style.color = (target === 'block' ? '#d93025' : (target === 'follow' ? '#188038' : '#1a73e8')); tab.style.borderBottom = `2px solid ${tab.style.color}`; tab.style.fontWeight = 'bold'; }; }); const handle = document.getElementById('ns-drag-handle'); let isDragging = false, offset = [0, 0]; handle.onmousedown = (e) => { isDragging = true; offset = [panel.offsetLeft - e.clientX, panel.offsetTop - e.clientY]; }; document.onmousemove = (e) => { if (!isDragging) return; panel.style.left = (e.clientX offset[0]) 'px'; panel.style.top = (e.clientY offset[1]) 'px'; }; document.onmouseup = () => { isDragging = false; }; btn.onclick = () => { panel.style.display = 'block'; }; document.getElementById('ns-close-x').onclick = () => { panel.style.display = 'none'; }; document.getElementById('ns-save').onclick = () => { config = { block: { uids: parseInput(document.getElementById('in-b-uids').value), keys: parseInput(document.getElementById('in-b-keys').value) }, follow: { uids: parseInput(document.getElementById('in-f-uids').value), keys: parseInput(document.getElementById('in-f-keys').value) }, style: { titleColor: document.getElementById('in-s-tc').value, bgColor: document.getElementById('in-s-bg').value }, settings: { syncToOfficial: document.getElementById('in-s-sync').checked } }; GM_setValue('ns_enhanced_config', config); // 如果开启了同步,刷新时重新加载一下官方列表 if(config.settings.syncToOfficial) { API.fetchOfficialList(); } applyLogic(); panel.style.display = 'none'; }; }; // --- 启动流程 --- // 1. 如果开关已开启,先拉取官方列表 if (config.settings && config.settings.syncToOfficial) { API.fetchOfficialList(); } createUI(); applyLogic(); new MutationObserver(applyLogic).observe(document.body, { childList: true, subtree: true }); })();
点赞
  1. 鹿野雨心说道:

    好东西

发表回复

电子邮件地址不会被公开。必填项已用 * 标注

×
订阅图标按钮