2007-05-17

Re: NGワードを含むエントリをあぼんするGreasemonkey

// ==UserScript==
// @name	unvisualizer
// @namespace	http://anond.hatelabo.jp/
// @description	unvisualize section including specific word at Hatelabo::AnonymousDiary
// @include	http://anond.hatelabo.jp/*
// @exclude	http://anond.hatelabo.jp/hatena/*
// ==/UserScript==
(function() {
	var target = document.evaluate(
//		"//div[@class='section' and contains(descendant::text(),'\u3042\u307c\u3093')]",
		"//div[@class='section' and descendant::*[contains(text(),'NG') or contains(text(),'2ch')]]",
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);
	for(var i=0; i<target.snapshotLength; i++) {
		target.snapshotItem(i).style.display = "none";
	}
})();

キーワードべた書きだけど、とりあえずこんな感じで。

ただ、日本語がよくわからん。xpathって日本語だめ?'\u3042\u307c\u3093'って「あぼん」だよね?

コメントアウトしてあるやつもなんで駄目なのかわかんない。xpathよくわからん。

おして!エロイ人><

[追記]

念のため、excludeに自分のID以下のページを入れといた方が良いかもね。

その他、好きにして。

記事への反応 -

記事への反応(ブックマークコメント)

ログイン ユーザー登録
ようこそ ゲスト さん