// ==UserScript==
// @name dolc 清理垃圾帖子
// @namespace
// @description:en Filters out (censors) posts of trolls, for Discuz based foren. Made for DOLC.de, may require modifications on other foren.
// @description:cn Discuz 论坛在浏览器端屏蔽特定 ID 发言。适用于过滤各种五毛党,五美分党,无脑喷子。给DOLC.de 写的,用在其他论坛上可能需要修改。
// @include http://dolc.de/*
// @include http://*.dolc.de/*
// @version 0.0.1.20140928194100
// @namespace https://greasyfork.org/users/5686
// @downloadURL none
// ==/UserScript==
var dogs = new Array("hh2", "伟大领袖", "ein", "面瘫胡","flh", "Dortmund110","柳桂花","coxinga", "柳漫");
// 主题列表页
for (x in dogs) {
dog = document.evaluate('//table/tbody[tr[1]/td[2]//cite/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 = "
 | 造谣一时爽,全家火葬场:被屏蔽帖子 " + c + " | " + dogs[x] + " | | |
";
}
}
}
// 内容页
for (x in dogs) {
dog = document.evaluate('//table/tbody[tr[1]/td[1]//a[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 = "清扫垃圾人人有责:被屏蔽帖子 " + c + " " + dogs[x] + "";
}
}
}
for (x in dogs) {
dog = document.evaluate('//table/tbody[tr[1]/td[1]/div[1]//font[text()="' + dogs[x] + '"]]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
if (dog.snapshotLength) {
for (var i = 0, c = ""; i < dog.snapshotLength; i++) {
c = String(dog.snapshotItem(i).firstChild.childNodes[3].textContent.match(/\d+#/)).replace(/#/, "楼");
dog.snapshotItem(i).innerHTML = "c被屏蔽帖子 " + c + " " + dogs[x] + "";
}
}
}