「Trackback」を含む日記 RSS

はてなキーワード: Trackbackとは

2007-06-08

ついカッとなってやった

20070629230000改定

20070702125800バグ発見スクリプト中にある「&&」が、「&&」になっている。増田仕様らしい。

20070827224900改定

// ==UserScript==
// @name	anond pickup
// @namespace	http://anond.hatelabo.jp/20070608230645
// @description	pickup trackback tree top section at Hatelabo::AnonymousDiary
// @include	http://anond.hatelabo.jp/*
// ==/UserScript==
(function() {
	var threshold_bm = 1;
	var threshold_tb = 1;
	var ignoreList = {
		"/20070801172335": 33,
		"/20070806163721": 10,
	};
	var firstPager_l = document.evaluate("//div[@class='pager-l']",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;

	function Hide(){}
	Hide.prototype.setup = function() {
		this.style = document.createElement("style");
		this.style.id = "hide";
		this.style.type = "text/css";
		document.getElementsByTagName("head")[0].appendChild(this.style);
		var self = this;
		this.a = new Object();
		this.a.visible = document.createElement("a");
		this.a.visible.id = "visible";
		this.a.visible.href = "#";
		this.a.visible.innerHTML = "visible hide section";
//		this.a.visible.setAttribute("onclick","document.getElementById('hide').innerHTML = 'div.hide {display: block}';document.getElementById('visible').style.display = 'none';document.getElementById('unvisible').style.display = 'inline';");
		this.a.visible.addEventListener("click", function(){self.visible()}, false);
		firstPager_l.parentNode.insertBefore(this.a.visible, firstPager_l);
		this.a.unvisible = document.createElement("a");
		this.a.unvisible.id = "unvisible";
		this.a.unvisible.href = "#";
		this.a.unvisible.innerHTML = "unvisible hide section";
//		this.a.visible.setAttribute("onclick","document.getElementById('hide').innerHTML = 'div.hide {display: none}';document.getElementById('visible').style.display = 'inline';document.getElementById('unvisible').style.display = 'none';");
		this.a.unvisible.addEventListener("click", function(){self.unvisible()}, false);
		firstPager_l.parentNode.insertBefore(this.a.unvisible, firstPager_l);
		if (GM_getValue("visible", 0)) {
			this.visible();
		} else {
			this.unvisible();
		}
	}
	Hide.prototype.visible = function() {
		this.style.innerHTML = "div.hide {display: block}";
		this.a.visible.style.display = "none";
		this.a.unvisible.style.display = "inline";
		GM_setValue("visible", 1);
	}
	Hide.prototype.unvisible = function() {
		this.style.innerHTML = "div.hide {display: none}";
		this.a.visible.style.display = "inline";
		this.a.unvisible.style.display = "none";
		GM_setValue("visible", 0);
	}
	Hide.prototype.append = function(section) {
		if (section.className.match(/hide/)) {
			return;
		}
		section.className += " hide";
	}
	Hide.prototype.clear = function(section) {
		section.className = section.className.replace(/ hide/g, "");
	}
	Hide.prototype.is = function(section) {
		return section.className.match(/hide/);
	}
	var hide = new Hide();
	hide.setup();

	var target = document.evaluate(
		"//div[@class='section' and child::*[not(@class='sectionfooter') and descendant::a[starts-with(@href,'http://anond.hatelabo.jp/2') or starts-with(@href,'/2') and not(child::span[@class='sanchor'])]]]",
		document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
	for (var i=0; i<target.snapshotLength; i++) {
		hide.append(target.snapshotItem(i));
	}

	var tbs = document.evaluate(
		"//p[@class='sectionfooter']/a[2]",
		document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
	for (var i=0; i<tbs.snapshotLength; i++) {
		var tb = tbs.snapshotItem(i);
		if (tb.innerHTML == "\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af(0)") {
//			hide.append(tb.parentNode.parentNode);
			bookmark(tb, 0);
		} else if (! hide.is(tb.parentNode.parentNode)) {
			trackback(tb, 1);
		} else {
			bookmark(tb, 1);
		}
	}

	function trackback(tb, callback) {
		GM_xmlhttpRequest({
			method: "GET",
			url: "http://anond.hatelabo.jp/" + tb.pathname.match(/\d{14}/),
			onload: function(result) {
				var link = result.responseText.match(/<a name="tb">(.|\s)*/)[0].match(/<li>\s*<a href="http:\/\/anond.hatelabo.jp\/\d{14}"/g);
				var n = link.length;
				for (var l in link) {
					var m = "/" + link[l].match(/\d{14}/);
					if (m in ignoreList) {
						n -= ignoreList[m];
					}
				}
				if (n < threshold_tb) {
					tb.innerHTML = tb.innerHTML.replace(/\)$/, "/"+n+")");
					if (callback) {
						bookmark(tb);
					}
				} else {
					tb.innerHTML = tb.innerHTML.replace(/\)$/, '/<span style="color: red;">'+n+"</span>)");
				}
			}
		});
	}

	function bookmark(tb, callback){
		GM_xmlhttpRequest({
			method: "GET",
			url: "http://b.hatena.ne.jp/entry/rss/http://anond.hatelabo.jp/" + tb.pathname.match(/\d{14}/),
			onload: function(result) {
				var r = result.responseText.match(/<rdf:li rdf:resource=/g);
				if (r &amp;&amp; r.length >= threshold_bm){
					hide.clear(tb.parentNode.parentNode);
					if (callback) {
						trackback(tb);
					}
				} else {
					hide.append(tb.parentNode.parentNode);
				}
			}
		});
	}
})();

今はスッキリしているのは古いやつ

/// ==UserScript==
// @name	anond pickup
// @namespace	http://anond.hatelabo.jp/20070608230645
// @description	pickup trackback tree top section at Hatelabo::AnonymousDiary
// @include	http://anond.hatelabo.jp/*?page=*
// ==/UserScript==
(function() {
	var target = document.evaluate(
		"//div[@class='section' and child::*[not(@class='sectionfooter') and descendant::a[starts-with(@href,'http://anond.hatelabo.jp/2') or starts-with(@href,'/2') and not(child::span[@class='sanchor'])]]]",
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);
	for(var i=0; i<target.snapshotLength; i++) {
		target.snapshotItem(i).style.display = "none";
	}

	var trackback = document.evaluate(
		"//p[@class='sectionfooter']/a[2]",
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);
	for(var i=0; i<trackback.snapshotLength; i++) {
		if (trackback.snapshotItem(i).innerHTML == "\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af(0)") {
			trackback.snapshotItem(i).parentNode.parentNode.style.display = "none";
		} else if (trackback.snapshotItem(i).parentNode.parentNode.style.display != "none") {
			count(trackback.snapshotItem(i));
		}
	}

	function count(tb) {
		GM_xmlhttpRequest({
			method: "GET",
			url: "http://anond.hatelabo.jp/" + tb.getAttribute("href").match(/[0-9]{14}/),
			onload: function(result) {
				var n = result.responseText.replace(/\n/g,"").match(/<a name="tb">.*/)[0].match(/<li>/g).length;
				if (n < 10) {
					tb.innerHTML = tb.innerHTML.replace(/\)$/,"/"+n+")");
				} else {
					tb.innerHTML = tb.innerHTML.replace(/\)$/,'/<span style="color: red;">'+n+"</span>)");
				}
			}
		});
	}
})();

2007-05-14

52 :Trackback(774):2007/05/12(土) 21:10:22 ID:burbk2KI

茂木の脳"科学者"としての研究能力は3流以下。

なにしろ自分自身で出している原著的成果が超ショボい。有名な研究をしょぼく変更しただけ。

オリジナル性は皆無の上、発展性もほとんどない。

正直、うちの大学修士課程の院生の方がよっぽどまともな"研究"をする。

でも他者の研究の解釈・論評はなかなか良いものだし、それを物語る筆力は評価に値すると思う。

いわば「脳科学評論家」。そういう立場なら一流といっても差し支えない。

彼がもし純然たる脳科学者、あるいは認知科学者として実験

原著論文執筆に従事しても凡庸以下のものにしかなりえなかった。

彼は、彼の持ち合わせた能力を最も活かせるやり方をこなしているのだと思う。

2007-01-24

replyは単なるリンクだから

あれば便利で良いけど。なくてもtitleさえ渡せればいいよ。GMで追加するから。

私はanond:20070124114742に賛成。一覧はシンプルに時系列、パーマリンクで色々詳細。

あとあと。記事毎の情報(って今のところtitleとtrackbackぐらいか)をXMLで取得できるといいな。そうすればsuVeneさんとかがGMでぐりぐりやってくれそうだから!

またお昼休みに遊んでみて。

2007-01-17

Re: TrackBackして言及記事を消しても、TB先に概要が残るのはblogツールほぼ全ての共通仕様じゃないかな

はてなが独自に言及記事を消したら送信TBも消すという仕組みを実装してほしいというアイデアが有っても良いとは思うけど。

anondじゃないけどidea:2928

TrackBackして言及記事を消しても、TB先に概要が残るのはblogツールほぼ全ての共通仕様じゃないかな

http://anond.hatelabo.jp/20070117023914

トラバしてすぐ消した人へ

トラバして消しても

エントリ自体は消えるけど

トラバリストに残ってるURL

ポップアップで中身表示してくれるから

短い文章だと消す意味ないよ

はてなは早く直せばいいと思うよ

TrackBackの仕組みはメールみたいな一方的な送信手段だから。

一度送信したら言及した人が消そうと思ってもその仕組みが無いよ。

はてなが独自に言及記事を消したら送信TBも消すという仕組みを実装してほしいというアイデアが有っても良いとは思うけど。

それはいま世界に普及しているTrackBack仕様からはずいぶんかけ離れているので「早く直せばいいと思うよ」みたいな意味不具合とは違うと思う。

2007-01-11

イザ!トラックバックできない

リクエスト

POST /news/newsarticle/34435/TrackBack/ HTTP/1.0

Host: www.iza.ne.jp

Content-Type: application/x-www-form-urlencoded

Content-Length: 239

Accept: */*

url=http://anond.hatelabo.jp/20070111050543&title=%E8%8B%A5%E8%80%85%E3%81%AE%E3%83%A2%E3%83%A9%E3%83%AB%E3%81%8C%E4%BD%8E%E4%B8%8B%E3%81%97%E3%81%A6%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E6%9B%B8%E3%81%84%E3%81%A6%E3%81%84%E3%82%8B%E3%81%8C

応答:

HTTP/1.1 500 Internal Server Error

(もっとつづく)

trackback仕様上、エラーXMLフォーマットで返ってくるべきなのに、500って恥ずかしいよね。

え?エラーになるようなリクエストを送る方が恥ずかしいって?ごもっとも。

2006-12-11

892 :Trackback(774) :sage :2006/12/10(日) 04:19:17 ID:LePPfSqE

ネット建設的世界で、DIY精神が残っていたころだったら、

こういう場合は、「はてな脱出サポートチーム」みたいな

ボランティア集団ができて、さまざまな脱出法に関する

ガイドを書いていたりしたんだろうね。

893Trackback(774) :sage :2006/12/10(日) 04:27:26 ID:ZmZNCUpk

892 :Trackback(774) :sage :2006/12/10(日) 04:19:17 ID:LePPfSqE

ネット建設的世界で、DIY精神が残っていたころだったら、

こういう場合は、「はてな脱出サポートチーム」みたいな

ボランティア集団ができて、さまざまな脱出法に関する

ガイドを書いていたりしたんだろうね。

>>892

ボランティア精神に富んだ人たちはビヨンド悪マニ住所登録事件の時に

既に脱出してしまったので、はてな脱出サポートチームを作るには、

ビヨンド悪マニ登録事件以上の非常事態オウムとか)が起きて、

方々に散ってしまった勇者達を再結集しないとだめです。

はてなをやめて、どこ行こう?

http://pc8.2ch.net/test/read.cgi/blog/1099512494/l50

来年一月、はてなからの移民が大量に出ます。

http://pc8.2ch.net/test/read.cgi/blog/1099406419/l50

894 :Trackback(774) :sage :2006/12/10(日) 06:59:18 ID:1ltN1nbR(2)

>>892

逆に聞くが、何で君だけさっさとおさらばしてそれで終わりにしないのか。

所詮、ブログ界でもコアな層しか集まってない少数集団だぞ。

895 :Trackback(774) :sage :2006/12/10(日) 09:42:20 ID:XZNAfp+e

いまのはてなコミュニティというよりも植民地でしょ。

単体でもキャラ立ちする人、テキストそのもので勝負できる人の大多数は

よそに本拠を持っているし。

896 :Trackback(774) :sage :2006/12/10(日) 10:59:35 ID:IF9kNC2k(2)

893Trackback(774) :sage :2006/12/10(日) 04:27:26 ID:ZmZNCUpk

>>892

ボランティア精神に富んだ人たちはビヨンド悪マニ住所登録事件の時に

既に脱出してしまったので、はてな脱出サポートチームを作るには、

ビヨンド悪マニ登録事件以上の非常事態オウムとか)が起きて、

方々に散ってしまった勇者達を再結集しないとだめです。

はてなをやめて、どこ行こう?

http://pc8.2ch.net/test/read.cgi/blog/1099512494/l50

来年一月、はてなからの移民が大量に出ます。

http://pc8.2ch.net/test/read.cgi/blog/1099406419/l50

895 :Trackback(774) :sage :2006/12/10(日) 09:42:20 ID:XZNAfp+e

いまのはてなコミュニティというよりも植民地でしょ。

単体でもキャラ立ちする人、テキストそのもので勝負できる人の大多数は

よそに本拠を持っているし。

>>893

あれからもう2年くらい経つんですね

懐かしいなぁ

>>895

ですね

897 :Trackback(774) :sage :2006/12/10(日) 12:51:39 ID:1ltN1nbR(2)

>>895

そんなもん、人によるわな。

テキストそのもので勝負できる人」が場所を選ぶ理由がない。

あと、それはダイアリーしか見てない意見じゃん。

はてブの射程圏内にある非ダイアリーブログなんていくらでもある。

898 :Trackback(774) :sage :2006/12/10(日) 14:53:45 ID:IF9kNC2k(2)

はてなの歴史をだいたい分けると

こんな感じですかね

1.β版??正式版

2.住所登録騒動(CCCに個人情報)まで

3.オウム騒動まで

4.社長渡米まで

5.現在

899 :Trackback(774) :2006/12/10(日) 18:06:23 ID:vEy57Ei8

オウム騒動ははてな内ではそんなに大事件でなかったような。

900 :Trackback(774) :sage :2006/12/10(日) 21:29:29 ID:B/kXbFs4

はてなブログサービスを最初の方に始めたわけだから

本拠地にしてもいいはずだけどね。夜に落ちやすいからね。

901 :Trackback(774) :sage :2006/12/11(月) 13:15:29 ID:HVwc8FPj(2)

はてなってサイドバーの左右を入れ替えることは出来ないの?

Hatena_waterが左カラムなら完璧なのに

902 :Trackback(774) :sage :2006/12/11(月) 13:22:27 ID:kGpOdwSb

植民地乞食どもは自分でスタイルシートも変更できんのだとw

903Trackback(774) :sage :2006/12/11(月) 13:38:41 ID:HVwc8FPj(2)

902 :Trackback(774) :sage :2006/12/11(月) 13:22:27 ID:kGpOdwSb

植民地乞食どもは自分でスタイルシートも変更できんのだとw

解決しました

>>902サンクス

904 :Trackback(774) :sage :2006/12/11(月) 19:09:41 ID:EmZ1C/Kg

903Trackback(774) :sage :2006/12/11(月) 13:38:41 ID:HVwc8FPj(2)

解決しました

>>902サンクス

>>903

GJ!

2006-11-21

anond pickup of the day

以下の二つに留意、つまり乱用禁止。

取説未満

// ==UserScript==
// @name	anond pickup of the day
// @namespace	http://anond.hatelabo.jp/
// @description	pickup section of the day at Hatelabo::AnonymousDiary
// @include	http://anond.hatelabo.jp/2*
// ==/UserScript==
(function(){
	var trackbackThreshold = 10;
	var ignoreList = {
		"/20070801172335": 33,
		"/20070806163721": 10,
	};

	// only section of the day
	if (! location.pathname.match(/^\/\d{8}$/)) {
		return;
	}

	// regist ancher that kick main routine
	var a = document.createElement("a");
	a.href = "#";
	a.innerHTML = "pickup of the day";
	a.addEventListener("click", grab, false);
	var firstPager_l = document.evaluate("//div[@class='pager-l']",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;
	firstPager_l.appendChild(a);

	function Outline() {
		this.outline = document.createElement("ul");
		this.text = document.createElement("textarea");
		this.text.style.overflow = "auto";
		this.text.style.width = "100%";
		this.text.style.height = "15em";
		this.text.innerHTML = "</ul><\n><ul>\n";
		this.list = new Array();
	}
	Outline.prototype.setup = function() {
		var parent = document.getElementById("body");
		parent.insertBefore(this.outline, parent.firstChild);
		parent.insertBefore(this.text, parent.firstChild);
	}
	Outline.prototype.append = function(section) {
		var h3 = section.getElementsByTagName("h3")[0];
		var sectionName = h3.firstChild.pathname.replace(/\//,"");
		var sectionText = h3.textContent.replace(/\s*$/,"");
		if (sectionText == "\u25a0") {
			sectionText = sectionName;
		}
		this.text.innerHTML +=
			'<h2>[http://anond.hatelabo.jp/'+sectionName+
			":title="+sectionText.replace(/^\u25a0/,"").replace(/]/g,"&amp;#93;")+"] "+
			'<a href="http://b.hatena.ne.jp/entry/http://anond.hatelabo.jp/'+sectionName+'">'+
			'<img src="http://b.hatena.ne.jp/entry/image/http://anond.hatelabo.jp/'+sectionName+'">'+
			"</a></h2>\n";
		h3.firstChild.name = sectionName;
		var li = document.createElement("li");
		li.innerHTML =
			'<a href="#'+sectionName+'">' +
			sectionText.replace(/&amp;/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;") +
			"</a>";
		var nextSibling = 0;
		for (var i in this.list) {
			if (nextSibling < i &amp;&amp; i < sectionName) {
				nextSibling = i;
			}
		}
		if (nextSibling) {
			this.outline.insertBefore(li, this.list[nextSibling]);
		} else {
			this.outline.appendChild(li);
		}
		this.list[sectionName] = li;
	}
	var outline = new Outline();

	function CC(day) {
		this.li = document.createElement("li");
		this.li.innerHTML = '<a href="/'+day+'" target="_blank">' + day + "</a>";
		this.day = day;
		this.n = new Array();
	}
	CC.prototype.pp = function(id) {
		this.n.push(id);
		if (this.n.length > 10) {
			this.li.innerHTML = '<a href="/'+this.day+'" target="_blank">' + this.day + "</a> " + this.n.length;
		} else {
			this.li.innerHTML += ' <a href="/'+id+'" target="_blank">*</a>';
		}
	}

	function Count() {
		this.count = document.createElement("ul");
		this.list = new Array();
	}
	Count.prototype.setup = function() {
		var parent = document.getElementById("body");
		parent.insertBefore(this.count, parent.firstChild);
	}
	Count.prototype.append = function(day, id) {
		var nextSibling = 0;
		for (var i in this.list) {
			if (nextSibling < i &amp;&amp; i <= day) {
				nextSibling = i;
			}
		}
		if (nextSibling == day) {
			this.list[nextSibling].pp(id);
		} else {
			var cc = new CC(day);
			if (nextSibling) {
				this.count.insertBefore(cc.li, this.list[nextSibling].li);
			} else {
				this.count.appendChild(cc.li);
			}
			this.list[day] = cc;
			cc.pp(id);
		}
	}
	Count.prototype.appendSection = function(section) {
		var id = section.getElementsByTagName("h3")[0].firstChild.pathname.replace(/\//,"");
		var today = id.match(/\d{8}/)[0];
		var anchors = section.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			if (anchors[i].href &amp;&amp; anchors[i].host == "anond.hatelabo.jp" &amp;&amp; anchors[i].pathname.match(/\/(\d{8})\d{6}/) &amp;&amp; RegExp.$1 != today) {
				this.append(RegExp.$1, id);
			}
		}
	}
	var count = new Count();

	function Hide(){}
	Hide.prototype.setup = function() {
		this.style = document.createElement("style");
		this.style.id = "hide";
		this.style.type = "text/css";
		document.getElementsByTagName("head")[0].appendChild(this.style);
		var self = this;
		this.a = new Object();
		this.a.visible = document.createElement("a");
		this.a.visible.id = "visible";
		this.a.visible.href = "#";
		this.a.visible.innerHTML = "visible hide section";
//		this.a.visible.setAttribute("onclick","document.getElementById('hide').innerHTML = 'div.hide {display: block}';document.getElementById('visible').style.display = 'none';document.getElementById('unvisible').style.display = 'inline';");
		this.a.visible.addEventListener("click", function(){self.visible()}, false);
		firstPager_l.parentNode.insertBefore(this.a.visible, firstPager_l);
		this.a.unvisible = document.createElement("a");
		this.a.unvisible.id = "unvisible";
		this.a.unvisible.href = "#";
		this.a.unvisible.innerHTML = "unvisible hide section";
//		this.a.visible.setAttribute("onclick","document.getElementById('hide').innerHTML = 'div.hide {display: none}';document.getElementById('visible').style.display = 'inline';document.getElementById('unvisible').style.display = 'none';");
		this.a.unvisible.addEventListener("click", function(){self.unvisible()}, false);
		firstPager_l.parentNode.insertBefore(this.a.unvisible, firstPager_l);
		this.unvisible();
	}
	Hide.prototype.visible = function() {
		this.style.innerHTML = "div.hide {display: block}";
		this.a.visible.style.display = "none";
		this.a.unvisible.style.display = "inline";
	}
	Hide.prototype.unvisible = function() {
		this.style.innerHTML = "div.hide {display: none}";
		this.a.visible.style.display = "inline";
		this.a.unvisible.style.display = "none";
	}
	Hide.prototype.append = function(section) {
		if (section.className.match(/hide/)) {
			return;
		}
		section.className += " hide";
		count.appendSection(section);
	}
	Hide.prototype.is = function(section) {
		return section.className.match(/hide/);
	}
	var hide = new Hide();

	// main routine
	function grab(){
		if (! document.body.innerHTML.match(/<div class="pager-r">(\d+)/)) {
			return;
		}
		var pages = RegExp.$1 -0;
		if (pages <= 0 || pages > 40) { // check error and limit 1000 entry
			return;
		}
//pages = 2;

		firstPager_l.style.display = "none";
		outline.setup();
		hide.setup();
		count.setup();

		var mainbody = document.evaluate("//div[@class='body']", document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;
		mainbody.innerHTML = "\n";
		for (var i=1; i<=pages; i++) {
			cat(mainbody, i);
		}
	}

	// page load and concatenate
	function cat(container, page) {
		container.innerHTML += "<!-- page " + page + " -->\n";
		GM_xmlhttpRequest({
			method: "GET",
			url: "http://anond.hatelabo.jp" + location.pathname + "?page=" + page,
			onload: function(result) {
				result.responseText.match(/<div class="body">((.|\s)*?)\s*<\/div>\s*<\/div>\s*<div class="pager-l">/);
				container.innerHTML = container.innerHTML.replace("<!-- page " + page + " -->", RegExp.$1);
				if (! container.innerHTML.match(/<!-- page \d+ -->/)) {
//					document.documentElement.innerHTML = document.documentElement.innerHTML.replace(/(src|href)=\"\//mg, "$1=\"http://anond.hatelabo.jp/");
					pickup();
				}
			}
		});
	}

	// pickup section at last cat() concatenate after
	function pickup() {
		var target = document.evaluate(
			"//div[@class='section' and child::*[not(@class='sectionfooter') and descendant::a[starts-with(@href,'http://anond.hatelabo.jp/2') or starts-with(@href,'/2') and not(child::span[@class='sanchor'])]]]",
			document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
		for (var i=0; i<target.snapshotLength; i++) {
			hide.append(target.snapshotItem(i));
		}

		var tbs = document.evaluate(
			"//p[@class='sectionfooter']/a[2]",
			document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
		for (var i=0; i<tbs.snapshotLength; i++) {
			var tb = tbs.snapshotItem(i);
			if (tb.innerHTML == "\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af(0)") {
				hide.append(tb.parentNode.parentNode);
			} else if (! hide.is(tb.parentNode.parentNode)) {
				trackback(tb);
			}
		}
	}

	// count trackbacks
	function trackback(tb) {
		GM_xmlhttpRequest({
			method: "GET",
			url: "http://anond.hatelabo.jp/" + tb.pathname.match(/\d{14}/),
			onload: function(result) {
				var link = result.responseText.match(/<a name="tb">(.|\s)*/)[0].match(/<li>\s*<a href="http:\/\/anond.hatelabo.jp\/\d{14}"/g);
				var n = link.length;
				for (var l in link) {
					var m = "/" + link[l].match(/\d{14}/);
					if (m in ignoreList) {
						n -= ignoreList[m];
					}
				}
				if (n < trackbackThreshold) {
					hide.append(tb.parentNode.parentNode);
				} else {
					tb.innerHTML = tb.innerHTML.replace(/\)$/, "/"+n+")");
					outline.append(tb.parentNode.parentNode);
				}
			}
		});
	}

})();

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