关键词自己适当改改

70808

  • // ==UserScript==
  • // @name Discuz论坛 基于ID/标题关键词 屏蔽帖子
  • // @namespace lisanye
  • // @description 根据用户名、关键词,屏蔽帖子。支持配合翻页工具(例如uAutoPagerize2)
  • // @include /viewthread.php
  • // @include /thread
  • // @include /redirect.php
  • // @include /forum-redirect-tid
  • // @include /forum-viewthread-tid
  • // @include /forum.php?mod=viewthread
  • // @include /forum.php?mod=forumdisplay
  • // @include /forum-.html
  • // @version 20171009
  • // @grant none
  • // ==/UserScript==
  • - blockAll();
  • - var mo = new MutationObserver(function(allmutations) {
  • blockAll();
  • });
  • mo.observe(document.querySelector('body'), {'childList': true,'characterData':false,'subtree': true});
  • - function blockAll() {
  • var dogs = new Array("nouserid"); //要屏蔽的ID,写在这行,注意英文引号
  • var dogtitles = new Array("Vir", "vir","VIR","刀","$"); //要屏蔽的标题关键字,写在这行,注意英文引号
  • - // 主题列表页 针对ID
  • for (x in dogs) {
  • dog = document.evaluate('//table/tbody[tr[1]/td[2]//cite/a[text()="' + dogs + '"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  • if (dog.snapshotLength) {
  • for (var i = 0, c = ""; i **造谣一时爽,全家火葬场:被屏蔽帖子 " + c + "

" + dogs + "
";

  • dog.snapshotItem(i).innerHTML = "";
  • }
  • }
  • }
  • - // 内容页 针对ID
  • for (x in dogs) {
  • dog = document.evaluate('//table/tbody[tr[1]/td[1]//a[text()="' + dogs + '"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  • if (dog.snapshotLength) {
  • for (var i = 0, c = ""; i 9) ? c + "楼" : c;
  • //dog.snapshotItem(i).innerHTML = "" + c + " " + dogs + "";
  • dog.snapshotItem(i).innerHTML = "";
  • }
  • }
  • }
  • - // 主题列表页 针对标题
  • for (x in dogtitles) {
  • dog = document.evaluate('//table/tbody[tr[1]/th[1]/a[contains(text(),"' + dogtitles + '")]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  • if (dog.snapshotLength) {
  • for (var i = 0, c = ""; i c被屏蔽帖子 " + c + "

" + dogs + "
**";

  • //dog.snapshotItem(i).innerHTML = "";
  • }
  • }
  • }
  • }复制代码

脚本原地址:https://greasyfork.org/zh-CN/scripts/27275-discuz%E8%AE%BA%E5%9D%9B-%E5%9F%BA%E4%BA%8Eid-%E6%A0%87%E9%A2%98%E5%85%B3%E9%94%AE%E8%AF%8D-%E5%B1%8F%E8%94%BD%E5%B8%96%E5%AD%90/code