Skip to content

Instantly share code, notes, and snippets.

@vmi
Created November 3, 2010 01:36
Show Gist options
  • Save vmi/660669 to your computer and use it in GitHub Desktop.
Save vmi/660669 to your computer and use it in GitHub Desktop.
This is Firefox GreaseMonkey script, kill articles posted by f*cking gyosha.
// ==UserScript==
// @name kill_gyosha
// @namespace arcadia
// @description Kill articles posted by gyosha.
// @include http://www.mai-net.net/bbs/*
// @include http://mai-net.ath.cx/bbs/*
// ==/UserScript==
(function() {
// 業者が増えたらここをカスタマイズしてください
var GYOSHA_KEYWORDS = ['\\d+bag', 'bag\\d+', '竹村光一', '北川景子', '販売', '財布', '偽物ブランド', 'コピー商品'];
if (!document.URL.indexOf('?act=list&') < 0)
return;
var is_sst = document.URL.indexOf('/sst.php?') >= 0;
var re = new RegExp('(?:'+GYOSHA_KEYWORDS.join(')|(?:')+')');
var trs = document.getElementsByClassName('bgc');
var cnt = 0;
for (var i = trs.length - 1; i >= 0; --i) {
var tr = trs[i];
if (tr.tagName != 'TR')
continue;
if (tr.textContent.match(re)) {
cnt++;
GM_log(cnt + ' [' + tr.textContent + ']');
if (i == 0 && is_sst) {
var tds = tr.getElementsByTagName('td');
for (var i = tds.length - 1; i >= 3; --i)
tr.removeChild(tds[i]);
} else {
tr.parentNode.removeChild(tr);
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment