はてなキーワード: Trackbackとは
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 && 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>)"); } } }); } })();
水面上昇だけが温暖化の影響じゃないですよ。たとえば健康面で。
【人の健康 地球温暖化により死亡率や伝染病危険地域が増加する】
【[B-13 地球温暖化による人類の生存環境と環境リスクに関する研究]】
IPCCの報告書でも読めばいいじゃない。
trackback to 【「アル・ゴアに不都合な真実」】
http://anond.hatelabo.jp/20070117023914
トラバしてすぐ消した人へ
トラバして消しても
エントリ自体は消えるけど
ポップアップで中身表示してくれるから
短い文章だと消す意味ないよ
はてなは早く直せばいいと思うよ
TrackBackの仕組みはメールみたいな一方的な送信手段だから。
一度送信したら言及した人が消そうと思ってもその仕組みが無いよ。
はてなが独自に言及記事を消したら送信TBも消すという仕組みを実装してほしいというアイデアが有っても良いとは思うけど。
それはいま世界に普及しているTrackBackの仕様からはずいぶんかけ離れているので「早く直せばいいと思うよ」みたいな意味の不具合とは違うと思う。
POST /news/newsarticle/34435/TrackBack/ HTTP/1.0
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
(もっとつづく)
892 :Trackback(774) :sage :2006/12/10(日) 04:19:17 ID:LePPfSqE
ネットが建設的世界で、DIYな精神が残っていたころだったら、
ボランティア集団ができて、さまざまな脱出法に関する
ガイドを書いていたりしたんだろうね。
893 :Trackback(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)
893 :Trackback(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.β版??正式版
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)
902 :Trackback(774) :sage :2006/12/11(月) 13:22:27 ID:kGpOdwSb
903 :Trackback(774) :sage :2006/12/11(月) 13:38:41 ID:HVwc8FPj(2)
902 :Trackback(774) :sage :2006/12/11(月) 13:22:27 ID:kGpOdwSb
解決しました
>>902サンクス
904 :Trackback(774) :sage :2006/12/11(月) 19:09:41 ID:EmZ1C/Kg
903 :Trackback(774) :sage :2006/12/11(月) 13:38:41 ID:HVwc8FPj(2)
解決しました
>>902サンクス
>>903
GJ!
以下の二つに留意、つまり乱用禁止。
取説未満
// ==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,"&#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(/&/g,"&").replace(/</g,"<").replace(/>/g,">") + "</a>"; var nextSibling = 0; for (var i in this.list) { if (nextSibling < i && 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 && 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 && anchors[i].host == "anond.hatelabo.jp" && anchors[i].pathname.match(/\/(\d{8})\d{6}/) && 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); } } }); } })();