您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Ignore quotes from users you already ignore on the forum
// ==UserScript== // @name Full Ignore bitcointalk users // @version 0.1 // @description Ignore quotes from users you already ignore on the forum // @author TryNinja // @match https://bitcointalk.org/* // @icon https://www.google.com/s2/favicons?sz=64&domain=bitcointalk.org // @grant GM_setValue // @grant GM_getValue // @namespace https://greasyfork.org/users/1070272 // ==/UserScript== (async function () { 'use strict'; let list; const isLogged = document.querySelector('#hellomember') !== null; if (!isLogged) return; const getCachedList = () => { const cached = GM_getValue('ignoreListCache'); if (cached) { const parsed = JSON.parse(cached); const cacheDate = new Date(parsed.date); const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000); if (cacheDate > oneHourAgo) { return parsed; } } return null; }; const setCachedList = (list) => { return GM_setValue('ignoreListCache', JSON.stringify({ list, date: new Date().toISOString() })); }; const fetchIgnoreList = async () => { const res = await fetch('https://bitcointalk.org/index.php?action=profile;sa=ignprefs'); const html = await res.text(); const parser = new DOMParser(); const page = parser.parseFromString(html, 'text/html'); const ignoreListTextArea = page.querySelector('#ign_ignore_list'); const ignoreListUsers = ignoreListTextArea?.textContent?.split('\n'); return ignoreListUsers; }; const cached = getCachedList(); if (cached) { list = cached.list; } else { console.log('No cached ignore list, fetching now...') list = await fetchIgnoreList(); setCachedList(list); } console.log('ignore list', { list }); const quoteHeaders = document.querySelectorAll('.post .quoteheader') for (const quoteHeader of quoteHeaders) { const quoteBody = quoteHeader.nextElementSibling const authorMatch = quoteHeader.getHTML().match(/Quote from: (.*) on/) if (authorMatch && authorMatch[1]) { if (list.includes(authorMatch[1]) && quoteBody) { quoteBody.innerHTML = 'USER IS IGNORED' } } } })();