南+屏蔽垃圾帖子

This script is adapted from https://greasyfork.org/zh-CN/scripts/5346.Made for south-plus.net.

// ==UserScript==
// @name           南+屏蔽垃圾帖子
// @namespace discuz
// @description This script is adapted from https://greasyfork.org/zh-CN/scripts/5346.Made for south-plus.net.
// @description zh Discuz 论坛在浏览器端屏蔽特定 ID 的ZZ发贴和发言。
// @description 修改来自https://greasyfork.org/zh-CN/scripts/5346
// @include        http*://level-plus.net/*
// @include        http*://south-plus.net/*
// @include        http*://south-plus.org/*
// @include        http*://white-plus.net/*
// @include        http*://imoutolove.me/*
// @include        http*://*.level-plus.net/*
// @include        http*://*.south-plus.net/*
// @include        http*://*.south-plus.org/*
// @include        http*://*.white-plus.net/*
// @include        http*://*.imoutolove.me/*
// @version 1.6
// ==/UserScript==


//ID列表
//自行修改和添加,用法:于下方加入想屏蔽的用户名或uid, 用引号包围,半角逗号区隔,比如("天影风炫", "username"),默认屏蔽天影风炫,请自行增加/修改。注意自行备份屏蔽id/uid。
var dogs = new Array("天影风炫");
var uid = new Array("1115510");

// 主题列表页-PC
for (x in dogs) {
	dog = document.evaluate('//table/tbody[2]/tr[td[3]//a[text()="' + dogs[x] + '"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	if (dog.snapshotLength) {
		for (var i = 0, c = ""; i < dog.snapshotLength; i++) {
			dog.snapshotItem(i).innerHTML = "";
		}
	}
}

for (x in dogs) {
	dog = document.evaluate('//table/tbody[tr[1]/th[1]/div[2]/a[1]//strong[text()="' + dogs[x] + '"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	if (dog.snapshotLength) {
		for (var i = 0, c = ""; i < dog.snapshotLength; i++) {
			c = dog.snapshotItem(i).firstChild.childNodes[3].textContent.replace(/\s*/g, "").slice(0, 2);
			c = (Number(c) > 9) ? c + "楼" : c;
			dog.snapshotItem(i).innerHTML = "<b><center>清扫垃圾人人有责:被屏蔽帖子 " + c + " <font color=red>" + dogs[x] + "</font></center></b>";
			//若不想看到被屏蔽楼层,ID/uid,请将上面一行改为dog.snapshotItem(i).innerHTML = "";
		}
	}
}

//按uid屏蔽
for (x in uid) {
	dog = document.evaluate('//table/tbody[2]/tr[td[3]//a[@href="u.php?action-show-uid-' + uid[x] + '.html"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	if (dog.snapshotLength) {
		for (var i = 0, c = ""; i < dog.snapshotLength; i++) {
			dog.snapshotItem(i).innerHTML = "";
		}
	}
}

for (x in uid) {
	dog = document.evaluate('//table/tbody[tr[1]/th[1]/div[2]/a[@href="u.php?action-show-uid-' + uid[x] + '.html"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	if (dog.snapshotLength) {
		for (var i = 0, c = ""; i < dog.snapshotLength; i++) {
			c = dog.snapshotItem(i).firstChild.childNodes[3].textContent.replace(/\s*/g, "").slice(0, 2);
			c = (Number(c) > 9) ? c + "楼" : c;
			dog.snapshotItem(i).innerHTML = "<b><center>清扫垃圾人人有责:被屏蔽帖子 " + c + " <font color=red>uid:" + uid[x] + "</font></center></b>";
			//若不想看到被屏蔽楼层,ID/uid,请将上面一行改为dog.snapshotItem(i).innerHTML = "";
		}
	}
}