はてなキーワード:headとは
↓
<style type="text/css">dt{float:left;clear:left;width:10em;}</style>
<meta content="charset=Shift_JIS"/>
<script type="text/javascript"></p> <p>window.onload = init;</p> <p>varurl = [</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/h19sangiin/san_kekka/h19san_hkai.html">http://www.senkyo.metro.tokyo.jp/h19sangiin/san_kekka/h19san_hkai.html</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/h17shugiin/sokuhou/7kaijyo_s.htm">http://www.senkyo.metro.tokyo.jp/h17shugiin/sokuhou/7kaijyo_s.htm</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/h17togisen/sokuhou/2kaijyo_s.htm">http://www.senkyo.metro.tokyo.jp/h17togisen/sokuhou/2kaijyo_s.htm</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/data/h16san_hkai.html">http://www.senkyo.metro.tokyo.jp/data/h16san_hkai.html</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/data/h15shu_hkai.html">http://www.senkyo.metro.tokyo.jp/data/h15shu_hkai.html</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/data/data01_01_03.html">http://www.senkyo.metro.tokyo.jp/data/data01_01_03.html</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/data/data01_02_05.html">http://www.senkyo.metro.tokyo.jp/data/data01_02_05.html</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/data/data03_04.html">http://www.senkyo.metro.tokyo.jp/data/data03_04.html</a>",</p> <p> "<ahref="http://www.senkyo.metro.tokyo.jp/data/data01_05_05.html">http://www.senkyo.metro.tokyo.jp/data/data01_05_05.html</a>"</p> <p>];</p> <p>varbase = "<ahref="http://www.senkyo.metro.tokyo.jp/data/tokuhyo_23ku/">http://www.senkyo.metro.tokyo.jp/data/tokuhyo_23ku/</a>";</p> <p>var file = ["chiyoda","chuou","minato","shinjyuku","bunkyo",</p> <p> "taitho","sumida","koutho","sinagawa","meguro",</p> <p> "ohta","setagaya","shibuya","nakaono","suginami",</p> <p> "toshima","kita","arakawa","itabashi","nerima",</p> <p> "adachi","katushika","edogawa"];</p> <p>for(var i=0; i<23; i++){</p> <p>url.push(base + file[i] + "\.html");</p> <p>}</p> <p>varid = [</p> <p> "2007参院比", "2005衆院比", "2005都議会", "2004参院比", "2003衆院比",</p> <p> "2001参院比", "2001都議会", "2000衆院比", "1998参院比", "1997都議会"</p> <p>];</p> <p>var ku = [</p> <p> "千代田","中央","港","新宿","文京",</p> <p> "台東","墨田","江東","品川","目黒",</p> <p> "大田","世田谷","渋谷","中野","杉並",</p> <p> "豊島","北","荒川","板橋","練馬",</p> <p> "足立","葛飾","江戸川"</p> <p>];</p> <p>var regexku = newRegExp("(" + ku.join("|") + ")区");</p> <p>var iframe = [];</p> <p>var data = {};</p> <p>var parse = [ function(){</p> <p> var d = iframe[0].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.nodeValue)){</p> <p> for(var j=0, e=td[i]; j<10; j++){</p> <p> e = e.nextSibling;</p> <p> }</p> <p> data[RegExp.$1 + "0"] = e.firstChild.firstChild.nodeValue.replace(/\.\d+/,"");</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[1].contentWindow.document;</p> <p> var nobr = d.getElementsByTagName("nobr");</p> <p> for(var i=0, l=nobr.length; i<l; i++){</p> <p> if(regexku.test(nobr[i].firstChild.nodeValue)){</p> <p> for(var j=0, e=nobr[i].parentNode; j<4; j++){</p> <p> e = e.nextSibling;</p> <p> }</p> <p> data[RegExp.$1 + "1"] = e.firstChild.nodeValue;</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[2].contentWindow.document;</p> <p> var nobr = d.getElementsByTagName("nobr");</p> <p> for(var i=0, l=nobr.length; i<l; i++){</p> <p> if(regexku.test(nobr[i].firstChild.nodeValue) && nobr[i].parentNode.tagName == "SPAN"){</p> <p> for(var j=0, e=nobr[i]; j<6; j++){</p> <p> e = e.parentNode;</p> <p> }</p> <p> vare2 = e.nextSibling.nextSibling.firstChild.childNodes[2].firstChild;</p> <p> var k = 0;</p> <p> data[RegExp.$1 + "2"] = 0;</p> <p> while(e2){</p> <p> if(e2.firstChild.firstChild.nodeValue.indexOf("公明党") != -1){</p> <p> data[RegExp.$1 + "2"] += parseInt(e2.parentNode.nextSibling.childNodes[k+2].firstChild.nodeValue.replace(",",""), 10);</p> <p> }</p> <p>e2 =e2.nextSibling;</p> <p> k++;</p> <p> }</p> <p> data[RegExp.$1 + "2"] = int2str(data[RegExp.$1 + "2"]);</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[3].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.nodeValue)){</p> <p> for(var j=0, e=td[i]; j<19; j++){</p> <p> e = e.nextSibling;</p> <p> }</p> <p> data[RegExp.$1 + "3"] = e.firstChild.firstChild.nodeValue.replace(/\.\d+/,"");</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[4].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> var regexku2 = /(大田|世田谷|練馬|足立|江戸川)/;</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.nodeValue)){</p> <p> data[RegExp.$1 + "4"] = td[i].nextSibling.nextSibling.firstChild.nodeValue.replace(/\.\d+/,"");</p> <p>continue;</p> <p> }</p> <p> if(regexku2.test(td[i].firstChild.nodeValue)){</p> <p> data[RegExp.$1 + "4"] = (data[RegExp.$1 + "4"] || 0) </p> <p> + parseInt(td[i].nextSibling.nextSibling.firstChild.nodeValue.replace(",","").replace(/\.\d+/,""));</p> <p> }</p> <p> }</p> <p> for(var j=0; j<5; j++){</p> <p> data[ku[[10,11,19,20,22][j]]+"4"] = int2str(data[ku[[10,11,19,20,22][j]]+"4"]);</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[5].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.firstChild.nodeValue)){</p> <p> for(var j=0, e=td[i]; j<10; j++){</p> <p> e = e.nextSibling;</p> <p> }</p> <p> data[RegExp.$1 + "5"] = e.firstChild.firstChild.nodeValue.replace(/\.\d+/,"");</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[6].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.firstChild.nodeValue)){</p> <p> for(var j=0, e=td[i]; j<7; j++){</p> <p> e = e.nextSibling;</p> <p> }</p> <p> data[RegExp.$1 + "6"] = e.firstChild.firstChild.nodeValue.replace(/\.\d+/,"").replace("-","0");</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[7].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.firstChild.nodeValue)){</p> <p> for(var j=0, e=td[i]; j<9; j++){</p> <p> e = e.nextSibling;</p> <p> }</p> <p> data[RegExp.$1 + "7"] = e.firstChild.firstChild.nodeValue;</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(){</p> <p> var d = iframe[8].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if(regexku.test(td[i].firstChild.firstChild.nodeValue)){</p> <p> data[RegExp.$1 + "8"] = int2str(td[i].nextSibling.firstChild.firstChild.firstChild.nodeValue);</p> <p> }</p> <p> }</p> <p> show();</p> <p>}, function(n){ return function(){</p> <p> var d = iframe[n+9].contentWindow.document;</p> <p> var td = d.getElementsByTagName("td");</p> <p> data[ku[n]+"9"] = 0;</p> <p> for(var i=0, l=td.length; i<l; i++){</p> <p> if((((td[i].firstChild || 0).firstChild || 0).nodeValue || "").indexOf("公明") == 0){</p> <p> data[ku[n]+"9"] += parseInt(td[i].parentNode.lastChild.firstChild.firstChild.nodeValue.replace(",",""));</p> <p> }</p> <p> }</p> <p> data[ku[n]+"9"] = int2str(data[ku[n]+"9"]);</p> <p> show();</p> <p>}}];</p> <p>function init(){</p> <p> for(var i=0; i<23; i++){</p> <p> vardl = document.createElement("dl");</p> <p>dl.appendChild(document.createTextNode("\n【" + ku[i] + "区における公明票】\n"));</p> <p> for(var j=0; j<10; j++){</p> <p> vardt = document.createElement("dt");</p> <p> vardd = document.createElement("dd");</p> <p>dt.innerText =id[j];</p> <p>dl.appendChild(dt);</p> <p>dl.appendChild(dd);</p> <p> }</p> <p> document.body.firstChild.appendChild(dl);</p> <p> }</p> <p> for(var i=0; i<32; i++){</p> <p> var e = document.createElement("iframe");</p> <p> iframe[i] = e;</p> <p> e.style.display = "none";</p> <p> if(i<9) var f = parse[i];</p> <p> else var f = parse[9](i-9);</p> <p> e.attachEvent("onload", f);</p> <p> e.src =url[i];</p> <p> document.body.appendChild(e);</p> <p> }</p> <p>}</p> <p>function show(){</p> <p> for(var i=0; i<23; i++){</p> <p> vardl = document.body.firstChild.childNodes[i];</p> <p> for(var j=0; j<10; j++){</p> <p> vardt =dl.childNodes[j*2+1];</p> <p>dt.innerText =id[j] + " " + (data[ku[i]+j] || "");</p> <p>dt.nextSibling.innerText =bar(data[ku[i]+j], j);</p> <p> }</p> <p> }</p> <p>}</p> <p>function int2str(num){</p> <p> return newString(num).split("").reverse().join("").replace(/(\d{3})/g,"$1,").split("").reverse().join("");</p> <p>}</p> <p>functionbar(str,flag){</p> <p>str =str || "";</p> <p> if(str == "" ||str.length < 5) return "";</p> <p> var num = parseInt(str.match(/\d+/)) + 1;</p> <p> var arrow = (flag == 2 ||flag == 6 ||flag == 9) ? " ←" : "";</p> <p> var _bar = new Array(num).join("|") + arrow;</p> <p> return _bar;</p> <p>}</p> <p></script>
1, 2, 3, 4!
Almost every day
ほとんど毎日
I see the same face
同じ顔を
On broken picturetube
壊れたテレビで見るぜ
It fits theattitude
態度にピッタリだな
If you could see yourself
自分自身を見直してみろ
You put you on a shelf
自分のことを棚に上げながら
Yourverbal masturbate
口先だけのオナニーや
Promise to nauseate
Today I'll play the part of non-parent
Notmake a hundred rules
100個もルールを作る気にもならない
For you to know about yourself
お前が自分自身についてわかるように
Not lie andmake you believe
嘘なしで信じさせてやる
What's evil is makinglove
セックスも
and making friends
友達も
and meetingGod you're own way
神様に祈るのも悪いことさ
The right way
こいつが正しいんだ
(Chorus)
To see
見てみろ
To bleed
血を流してみろ
Cannot be taught
教えられることじゃねえ
In turn
次々に
You're making us
お前が俺を作ってるんだな
Ohhhh Fucking hostile
なんてお前は敵対的なんだ
We stand alone
俺たちは一人ぼっちってことさ
Thetruth in right and wrong
真実は間違ってるけど正しい
The boundaries of the law
法律すれすれのところで
You seem to miss the point
お前はしくじっちゃったみたいだな
Arresting for a joint?
マリファナに気づかれちまったのか?
You seem to wonderwhy
どうしてって聞きたいみたいだな
Hundreds of people die
何百もの人が死んでいって
You're writing tickets man
お前はその切符を書いてる
Mymom got jumped -- they ran!
母親が飛ぶとあいつらは走るから
Now I'll play a public servant
警察と今遊んでるのさ
To serve and protect
奉仕して、守って
By the law and thestate
法と国家によって
I'd bust the punks
That rape steal and murder
And leave you be
お前をそんなふうにして
If you crossed me
俺ともう一回会えるなら
I'd shake your hand like a man
Not agod
神じゃなくて
(Chorus)
Come meet your maker, boy
お前の親父に会わせろよ
Some things youcan't enjoy
享受できないことだってあるさ
天国と地獄のせいさ
A fucking wives' tale
糞みたいな物語を
They put it in yourhead
あいつらがお前の頭の中に入れて
Then put you in yourbed
ベッドのそばで子守唄にする
He's watching say your prayers
お前のために祈ってる奴を見ろってあいつは言うなあ
CauseGod is everywhere
神様はどこにでもいるからだってさ
Now I'll play a man learning priesthood
じゃあ俺は聖職者に付き従ってる男の役でもやってみよう
Who's about totake the ultimatetest inlife
誰が人生最大の問いなんてものを投げかけてきても
I'd question things because Iamhuman
俺は人間だから答えてやろう
And call NOONE my fatherwho's nocloser than a stranger
知らない奴より神様に近い奴なんていなんだ
I won't listen
聞きたくもないんだ
To see
見てみろ
To bleed
血を流してみろ
Cannot be taught
教えられることじゃねえ
In turn
次々に
You're making us
お前が俺をつくってるんだな
Fucking, fucking, fucking
糞みたいに
FUCKING HOSTILE!
お前は敵対的なんだ
安らかに眠れ
ダイムバッグダレル
<html><head><styletype="text/css">a.amazon+a{display:none}a.amazon:visited+a{display:inline}a.example+a{display:none}a.example:visited+a{display:inline}</style></head><body><ahref="http://www.amazon.co.jp/"class="amazon"></a><ahref="http://www.amazon.co.jp/exec/obidos/ASIN/4407316438"><imgsrc="http://ecx.images-amazon.com/images/I/41eRtLoQJtL._SL160_.jpg" /></a><ahref="http://www.example.com./"class="example"></a><ahref="http://d.hatena.ne.jp/asin/4407316438"><imgsrc="http://ecx.images-amazon.com/images/I/41eRtLoQJtL._SL160_.jpg" /></a></body></html>
IEはどうしたら良いですか!
教えてはまちちゃん!!
はい!こんにちは! Hamachiya2ですよ!
いま、エガミくんの書き込みみながら、ざくっとソースみてみたよー。
XSSの対策ってね、ぼくもよくわかってないけど、
「出力時にエスケープする」っていうのが定石らしいよ。
でもエガミくんのやろうとしたのは「入力時のエスケープ」だね。
だから $_GET のところ(入力)で何かをするのではなくて…、
レスポンスのコーナーのところ。htmlに変数埋め込んでecho してるとこ。
そこの全ての変数をエスケープしちゃう方がいい感じかな。
その際に注意すべきは、htmlの属性内(alt=ナントカとか、src=ナントカとか)に変数を埋め込んでいる場合は、ちゃんとクオートの類もエスケープする感じ?
echo '<imgsrc="' . $hensuu . '"alt="ぺろぺろ" />';
とかなら、$hensuu はダブルクオートもエスケープだよ。
あ、htmlspecialchars ってダブルクオートはデフォルトで「"」に変換されるんだっけ?
ちょっと試してみてね。
もし↓こんな風に、htmlの属性のクオートにシングルクオートを使ってる場合だと…
echo "<imgsrc='" . $hensuu . '" alt='ぺろぺろ' />";
これは
echo "<imgsrc='" . htmlspecialchars($hensuu, ENT_QUOTES) . '" alt='ぺろぺろ' />";
こうする感じかな?
あと、サンプルコードには含まれていなかったけど、
本番の方だと、htmlのheadの中でも変数つかってるよね。
たとえば、xxxで検索すると、titleタグやメタタグにもxxxが入ってくる。
そのあたりも、とりあえず「表示しようとしてる箇所」の「表示する一歩手前」で全てエスケープしてやればいいと思うよ。
もしかしたら言ってること間違ってるかもしれないけど、
その時はきっと誰かが突っ込んでくれるはずー。
追記
あと、寂しいことってなに?
寝る前にいくつか返信。
http://anond.hatelabo.jp/20080902220835]
たぶんそうだと思う。
http://anond.hatelabo.jp/20080902221735]
でもほら、ダイアリーの立ち上げ当時は似たようなもんじゃないかと。
同様の意見としてb:id:hatayasanとかb:id:ululunとかb:id:nakano87とかb:id:te2uとかね。元記事にチェックボックス案もmetaを使う前提でチェックが off ならhead に件の meta を入れる
って書いてあるのになぁ。リテラシーって大事だ。
そっちの仕様は別にいいの。自社サービスの機能を使うのにmetaを本文に書かせるのがダメ。
b:id:masayc技術力を期待してはてな使ってる人ってどれくらいいるんだろうね?俺は、日本”語”でweb2.0ごっこしたいだけで、もし英語が達者ならdiggとdelicious使うけどな。
日本語のWeb2.0ごっこなら、私が唯一中期間使った例で申し訳ないけどドリコムブログの方が優れてた。使ってたの数年前だけど(今はWP)。例えばデザイン編集画面で、ブログの2or3カラムレイアウトに表示する要素をDnDで並べ替えたりとか。DHTMLすげーって感じ。
はてなはWeb2.0の特徴の一つと言われてるマッシュアップとかがろくにできない。はてなのデータを外で使うための機能は多いけど、外のサービスとかをはてなに持ち込めない。Blogパーツ、裏技使わないと自由に貼れないでしょ?
2.0っぽさではてなよりも劣ってるサービスってあんま無いんじゃなかろうかと。むしろ往年のWeb日記の仕様を引きずってるし、メジャーバージョンは1。Web1.9。
b:id:xevra技術的には指摘の通りだろう。だが経営的にはこれが正解。なぜなら一覧非表示機能を希望し、文句言ってくる人は0.01%程度。この程度のものにリソースは割けない。完璧を求めるのは趣味の領域。jkonは正しい。
今は一覧非表示機能に限った話してないんだけど。上の方のアレもそうだけど、非表示絡みでコメしてる人は何故かピントが合わない。
例えばブログモード使ってる人ってけっこう多いけど、彼らは絶対に記事毎に編集やコメント管理できた方が便利。トラバ先を記憶する機能ってそんなに開発リソース必要ですか。大した事無い機能変更にもがっつりリソースを割かないと改善できないのが問題。
まぁでも確かに、現在のはてダの低い技術ポテンシャルという前提の下では、jkonは正しいね。
b:id:ghostbass なんだって??テーブルの変更なんか必要ないけど?
そうなんですか。考えてみます。思いつかなかったら勉強してみます。Boromさんの案が正解かも。
b:id:EvilGood おそらくそうなんだろうけど、小手先回避なんだろうとは思うが、さきざきサーバーの処理能力が上がって、すべて記法解析でやった方が速度出る日が来そうなんだよな。はてなはXMLDBとか検討してるんだろうか?
はてなが未来を見据えてそういう拡張をしてきたのか、という点はさておき、すべてを記法でやろうとすると記事の編集時の可読性が下がります。本文にmetaとか記事見出しなのに何故か本文にあるとかトラバ送ったかどうか解らないとか。
ユーザーの快適性とか開発の柔軟性とかを犠牲にしてまで、未来の鯖速度を追求するというのはなかなかどうも、説得されないです。
さらに追記。
b:id:skiccoはてな記法でごまかしてくれたおかげで、他のブログサービスではできない重複したカテゴリへの登録ができてる。これが可能なのってはてダくらいじゃね?
最近のブログサービスは知らないですけど、WordPressではできます。ところでカテゴリってリストから選べないとTypo りますよね。
ごめん、年1000万の間違いだったかも。倍近く違うじゃん。malaさんが入社したてのころにどっかでこういうの書いてた。うるおぼえ。
b:id:kana-kana_ceo 「普通なら、日記の編集フォームに一つ『ブクマページでブコメを表示する』というチェックボックスを付ける。チェックが off ならhead に件の meta を入れる」← なんで、非表示がデフォなんだろう?
一人くらい勘違いする人がいるとは思ってた。非表示がデフォなんて書いてない。デフォでチェックが on にしてあればおk。
チェックボックスのラベルは肯定文で書くのがUI の Tips。「非」表示は否定語。
b:id:al001 "少なくとも"技術力の問題では無いと思うが。面倒とかそういうのであれば分かるけど。 /チェックボックスでオンオフ出来るだけで良いなら、DB弄らずともJavaScriptだけで出来る。
まず後半。またまたご冗談を。クライアントサイドの解決法じゃ meta がbody の下にある事は変わらなかろうて。パース後に動かすつもり?
そういや手元で試してみたら、Firebug でソースを見るとbody 内の meta もhead の下にあったものとしてパースされるね。
前半は、他の人も同様の事言ってますね。要するに費用対効果の話。
でも、面倒
=費用が高くついてるのはシステムの出来が悪いから。スパゲッティーを紐解きたくないんでしょう。
ブコメ非表示みたいなおそらくほとんど使われないような機能だけがこうやって糞仕様存置されてるってんなら、経営判断って意見も説得力がありますね。
ここで糞仕様と言ってるのは meta で判別する仕様とかbody 内の meta を拾っちゃう仕様とか、ではなく、はてダの仕様のクソさを言ってます。
これまた至る所で指摘されてるけど、普通なら、日記の編集フォームに一つ「ブクマページでブコメを表示する」というチェックボックスを付ける。チェックが off ならhead に件の meta を入れる。
こんだけあちこちで言われてるアイディアですから、当然スタッフは思いついたでしょう。さすがにそこまで馬鹿じゃないでしょう。
でも実装しませんでした。実装できないんです。
ダイアリーに関してはその通りだと思うし、ぜひチェックボックスはつけて欲しい。でも、ダイアリー以外のブログや日記のことも考えると、本文中に書くということの意味もあると思う。好きなようにmetaタグをheadに入れることが出来るとは限らないから。
はてなブックマークのコメント一覧非表示機能について - はてなブックマーク日記 - 機能変更、お知らせなど
みんな知ってる記事だよね。
ブコメでもちらほら批判されてるけど、
なんてのはとんでもない糞仕様。
こんなWeb標準違反をユーザーに強いるのはバカでアホ。低脳でワーキングプア、と言いたいところだけど、何気に月収100万だったりするからワーキングプアは違いますねごめんなさい。
この仕様が糞だと判別するのは刺身にタンポポ乗せるよりも容易なので、要するにはてなは解ってて直せないんです。
ここで糞仕様と言ってるのは meta で判別する仕様とかbody 内の meta を拾っちゃう仕様とか、ではなく、はてダの仕様のクソさを言ってます。
これまた至る所で指摘されてるけど、普通なら、日記の編集フォームに一つ「ブクマページでブコメを表示する」というチェックボックスを付ける。チェックが off ならhead に件の meta を入れる。
こんだけあちこちで言われてるアイディアですから、当然スタッフは思いついたでしょう。さすがにそこまで馬鹿じゃないでしょう。
でも実装しませんでした。実装できないんです。
なぜ実装できないか。それは、フォームを増やすと記憶すべきテーブルが変わっちゃうからです。各日記毎に1つ、 BOOL 型を余分に記憶しなきゃいけないからです。
その程度の変更、大した事無いような気がします。でもはてな的にはできません。
はてなは何故か、はてダの個別記事の記憶の仕方を変更できません。実はこれは今回が初めてじゃありません。
はてダには日記モードの他に「ブログモード」などという名前に偽りのあるモードがあります。このモードにすると、日付ではなく個別の記事単位での表示も可能になります。一日に複数の記事を投稿できます。
でも、何故か、編集は日付単位でしかできません。「見出し記法」なる抜け道で、擬似的にブログを実現してるに過ぎません。だからコメントとかトラバはまともに管理できない。
なぜ記事毎の編集にできないか。日付で管理するはてな「ダイアリー」のシステムを変更できないからです。
はてダはトラックバックは実装してます。なぜならトラバは送りっ放しで良いから、何も記憶しなくていいからです。
でも、少なくないブログエンジンは、トラバの送り先も記憶します。「あれ?送ってないっけ?」とか勘違いしないで済みます。
なぜはてダはトラバの送り先を記憶しないか。記憶できるようにするには、各記事毎に新たなテーブルを用意することになるからです。
記事をカテゴリー(っつーかタグ)毎に分ける機能も、ちゃんとは実装されてません。はてな記法と検索で誤摩化してます。
記事毎にカテゴリーを記憶するにはデータベースを弄らなきゃいけないからです。
◯◯記法の多彩さであたかも凄い事をやってるかのように見せかけてますが、実際には、◯◯記法はデータを読み込んで吐き出すところにフックするだけです。
小手先の技術が巧みなのは認めましょう。
でも、小手先の技術ですべてを実現せざるを得ないから、こうやって筋の悪い仕様があちこちに出てくる。
★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
_________________ここから下は古い情報▼__________________________________________________
上記cssを2chで宣伝してみたら、こんなのがあるよと、 http://d.hatena.ne.jp/oryzan/20080706 を教えてもらいました。
ここで公開されているbookmarkretを借用してblack-out.css版bookmarkletを作ってみました。
現在、Mac版Firefox3と、Mac版Sfari、Mac版Operaで動作を確認。(ぱっと見だけどね)
bookmarkletなので面倒なアドオンインストールなどもすることなく、お手軽にテキストブラウジングがお楽しみ頂けます。
良かったらドゾー
javascript:(function(){var%20css='@import%20url(http://example.com/black-out.css);';var%20d=document.getElementsByTagName('style');for%20(var%20i=0,%20di;%20di=d%5Bi%5D;%20i++){if(di.innerText==css){di.parentNode.removeChild(di);return};};var%20heads=document.getElementsByTagName('head');if(heads.length%20%3E%200){var%20node=document.createElement('style');node.type='text/css';node.appendChild(document.createTextNode(css));heads%5B0%5D.appendChild(node);}})()
133名盤さん [] Date:2008/05/10(土) 00:11:05ID:uW+7WZgx Be:
NME 年間ベストアルバム1980-2007
1980Joy Division /Closer
1981Grace Jones / Nightclubbing
1982Marvin Gaye / Midnightlove
1983Elvis Costello / Punch The Clock
1984Bobby Womack / Poet 2
1986Prince & theRevolution / Parade
1987Public Enemy / Yo bumrush the show
1988Public Enemy / It Takes A Nation Of Millions..
1990De La Soul / 3 Feet high & rising
1990Happy Mondays / Pills 'n' thrills and bellyaches
1993Bjork / Debut
1994Oasis / Definitely Maybe
1995 Tricky / Maxinquaye
1996Beck / Odelay
1997Spiritualized / Ladies And Gentleman We Are Floating In Space
1998Mercury Rev / DesertersSongs
1999The Flaming Lips / TheSoft Bulletin
2000Queens Of The Stone Age ? Rated R
2001The Strokes / Is This It
2002Coldplay / ARush OfBlood To TheHead
2003The White Stripes / Elephant
2004Franz Ferdinand /Franz Ferdinand
2005Bloc Party ? Silent Alarm
2006Arctic Monkeys / Whatever People Say IAm, That’s What I’m Not
2007Klaxons / Myths Of The Near Future
134名盤さん [] Date:2008/05/10(土) 00:12:00ID:uW+7WZgx Be:
Rolling Stone 年間ベストアルバム1980-2007
1981 Rolling Stones /Tatoo You
1982Bruce Springsteen / Nebraska and R. & L.Thompson / Shootout the lights
1983R.E.M. / Murmur
1984Bruce Springsteen / Born In The U.S.A.
1985Talking Heads /Little Creatures
1986Paul Simon / Graceland
1987Bruce Springsteen / Tunnel OfLove
1988 Midnight Oil /Diesel and Dust
1989Neil Young /Freedom
1990 Sinead O'Connor / I Do Not Want What IHaven't Got
1992R.E.M. /Automatic For The People
1993Nirvana / In Utero
1995PJ Harvey / To Bring You MyLove
1996Beck / Odelay
1997Bob Dylan /TimeOut Of Mind
1998Lauryn Hill / The Miseducation ofLauryn Hill
1999Rage Against The Machine / The Battle of Los Angeles
2000Eminem / The Marshall MathersLP
2003OutKast / Speakerboxxx/The Love Below
2004Kanye West / The College Dropout
2005Kanye West / Late Registration
2006Bob Dylan / Modern Times
2007MIA / Kala
135名盤さん [] Date:2008/05/10(土) 00:42:04ID:uW+7WZgx Be:
おまけ
rockin'on 年間ベストアルバム 2002-2007
2002Red Hot Chili Peppers / By the Way
2003Radiohead / Hail to the Thief
2004Green Day / American Idiot
2005Oasis / Don't Believe TheTruth
2006Red Hot Chili Peppers / Stadium Arcadium
2007Radiohead /In Rainbows
1997Radiohead / OK Computer
1998Elliott Smith /XO
1999Super Furry Animals / Guerilla
2000FUMIYA TANAKA / UNKNOWNPOSSIBILITY vol.2
2001Super Furry Animals /RingsAround The World
2003Outkast / Speakerboxxx/The Love Below
2004The Libertines /The Libertines
2006Arctic Monkeys / Whatever People Say IAm, That’s What I’m Not
2007Radiohead /In Rainbows
結局概要表示機能追加した。unsafeWindow使いまくり。大丈夫かいな。
// ==UserScript==// @nameHatenaBookmarkTree Expander// @namespacehttp://anond.hatelabo.jp/// @includehttp://b.hatena.ne.jp/entry/*// ==/UserScript==// <div class="info">// <ulid="similar_entries" class="bookmarklist">// <li></li>// </ul>// </div>// <div class="info">// <ulid="referred_entries" class="bookmarklist">// <liid="referred-entry-\d+"></li>// </ul>// </div>// <div class="info">// <ulid="relation_diary" class="bookmarklist">// <liid="diary-{id}-\d+"></li>// </ul>// </div>(function() {function main() {loadBookmarkCommentViewer();similar.prototype.rootAppend();referred.prototype.rootAppend();}function HBTM(target) {this.target = target;this.targetXPath = "//ul[@id='"+target+"']/li";this.targetRegExp = newRegExp('<ulid="'+target+'"(.|\\s)*?</ul>');}HBTM.prototype = {openIcon:'<img width="15" height="15" class="icon" style="opacity: 0.6"src="http://anond.hatelabo.jp/images/common/open.gif"/>',closeIcon:'<img width="15" height="15" class="icon" style="opacity: 0.6"src="http://anond.hatelabo.jp/images/common/close.gif"/>',loadingIcon:'<img width="13" height="13" class="icon"src="http://anond.hatelabo.jp/images/common/loading.gif"/>',commentIcon: function(url) {return '<img class="hatena-bcomment-view-icon"src="http://r.hatena.ne.jp/images/popup.gif" onclick="iconImageClickHandler(this, \''+url+'\', event);">'},create: function() {this.comment = document.createElement("span");this.comment.innerHTML = this.commentIcon($X("string(descendant::a/@href)", this.node).value());this.open = document.createElement("a");this.open.href = "javascript:void(0)";this.open.innerHTML = this.openIcon;this.close = document.createElement("a");this.close.href = "javascript:void(0)";this.close.innerHTML = this.closeIcon;this.close.style.display = "none";this.loading = document.createElement("span");this.loading.innerHTML = this.loadingIcon;this.loading.style.display = "none";this.node.appendChild(this.comment);this.node.appendChild(document.createTextNode(" "));this.node.appendChild(this.open);this.node.appendChild(this.close);this.node.appendChild(this.loading);this.open.addEventListener("click",bind(this.openAct, this), false);this.close.addEventListener("click",bind(this.closeAct, this), false);},openAct: function() {this.open.style.display = "none";if (this.tree) {this.tree.style.display = "block";this.close.style.display = "inline";} else {this.loading.style.display = "inline";this.load();}},closeAct: function() {if (this.tree) {this.tree.style.display = "none";this.close.style.display = "none";this.open.style.display = "inline";}},load: function() {varurl = $X("string(descendant::a[starts-with(@href, '/entry/')]/@href)", this.node).value();GM_xmlhttpRequest({method: "GET",url: "http://b.hatena.ne.jp"+url,onload:bind(this.loadCallback, this)});},loadCallback: function(result) {var match = result.responseText.match(this.targetRegExp);if (match) {var sandbox = document.createElement("div");sandbox.innerHTML = match[0].replace(this.target,"");this.tree = sandbox.firstChild;} else {this.tree = document.createElement("ul");}this.append();this.loading.style.display = "none";this.close.style.display = "inline";},append: function() {this.tree.style.backgroundColor = "transparent";this.tree.style.listStyleType = "circle";this.node.appendChild(this.tree);$X("li", this.tree).each(function(n) {var a = $X("a",n).node();var c = $X("count(//li/a[@href='"+a.href+"'])").value();if (c > 1) n.parentNode.removeChild(n);});$X("li", this.tree).each(bind(function(node){new this.constructor(node)}, this));},rootAppend: function() {$X(this.targetXPath).each(bind(function(node){new this.constructor(node)}, this));}};function similar(node) {this.node = node;this.create();}similar.prototype = new HBTM("similar_entries");similar.prototype.constructor = similar;function referred(node) {this.node = node;this.create();}referred.prototype = new HBTM("referred_entries");referred.prototype.constructor = referred;function loadBookmarkCommentViewer() {varhead = document.getElementsByTagName("head")[0];varscript = document.createElement("script");script.type = "text/javascript";script.src = "http://b.hatena.ne.jp/js/BookmarkCommentViewerAllInOne.1.2.js";head.appendChild(script);varcss = document.createElement("link");css.rel="stylesheet";css.href="http://d.hatena.ne.jp/css/base.css";css.type="text/css";css.media="all";head.insertBefore(css,head.firstChild);window.addEventListener("load",function(){var BCV = unsafeWindow.BookmarkCommentViewer;BCV.options['screenshot'] = true;var asyncCommnetView = BCV.asyncCommnetView;BCV.asyncCommnetView = function(url, onCompleteCallback) {var div = asyncCommnetView(url, function(){onCompleteCallback.apply(this, arguments);new unsafeWindow.Ten.XHR("http://b.hatena.ne.jp/entry/rss/"+url, {}, function(result) {if (! result.responseText.match(/<description>(.*?)<\/description>/))return;if (!RegExp.$1)return;//var desc = document.createTextNode("desc: "+RegExp.$1);var desc = document.createElement("li");desc.appendChild(document.createTextNode("desc: "+RegExp.$1));div.lastChild.insertBefore(desc,div.lastChild.getElementsByTagName("li")[0]);});});return div;};BCV.asyncCommnetView.origin = asyncCommnetView;}, false);}functionbind(f,o) {return function() {return f.apply(o, arguments)}}function $X(xpath, context) {if (!(this instanceof $X))return new $X(xpath, context);this.xpath =xpath;this.context = context || document;}$X.prototype = {evaluate: function() {var result = document.evaluate(this.xpath, this.context, null, this.type, null);switch (result.resultType) {case XPathResult.STRING_TYPE : return result.stringValue;case XPathResult.NUMBER_TYPE : return result.numberValue;case XPathResult.BOOLEAN_TYPE: return result.booleanValue;case XPathResult.FIRST_ORDERED_NODE_TYPE: return result.singleNodeValue;}return result;},node: function() {this.type = XPathResult.FIRST_ORDERED_NODE_TYPE;return this.evaluate();},value: function() {this.type = XPathResult.ANY_TYPE;return this.evaluate();},each: function(func) {this.type = XPathResult.ORDERED_NODE_SNAPSHOT_TYPE;var result = this.evaluate();for (var i=0; i<result.snapshotLength; i++)func(result.snapshotItem(i));}};main();})();
サーバーサイドでマジメに作ったら逮捕されるんだろうか…?けーさつこわいから悪用とかしないでね><
ところで2chのどっかの板の名前欄って人名と地名がランダム表示されるけど、どうやってリストを作成してるんだろ?
<html><head><title>反抗予告ジェネレータ</title><script type="text/javascript"><!--var safe_mode = 1;var date, place,object, action;date = get_date();object = get_object();action = get_action();httpRequest("http://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E3%81%AE%E5%A4%A7%E5%AD%A6%E4%B8%80%E8%A6%A7");function get_date(){varnow =new Date();now.setTime(now.getTime() + Math.floor(Math.random()*1000*60*60*24*30));if (safe_mode != 0){now.setTime(now.getTime() + 1000*60*60*24*(365*3+366)/4*100);}returnnow.getYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日"+now.getHours()+"時"+now.getMinutes()+"分"+now.getSeconds()+"秒";}function get_object(){var b = ["小女子","増田","ひろゆき","ぬこ"];return b[Math.floor(Math.random()*b.length)];}function get_action(){var b = ["投","SATSUGAI","なでなで","もふもふ"];return b[Math.floor(Math.random()*b.length)];}function httpRequest(target_url){try{if(window.XMLHttpRequest){httpObj =newXMLHttpRequest();}elseif(window.ActiveXObject){httpObj =new ActiveXObject("Microsoft.XMLHTTP");}else{return;}} catch(e){return;}httpObj.open("GET", target_url,true);httpObj.onreadystatechange = DataRead;httpObj.send("");return;}function DataRead(){if (httpObj.readyState == 4 && httpObj.status == 200){var res = httpObj.responseText;var b =new Array();b = res.match(/>([亜-熙]+)大学/g);place = b[Math.floor(Math.random()*b.length-1)].replace(">","");if (safe_mode != 0){ place = place.replace("大学","○○");}document.body.innerText = date+"に"+place+"あたりで"+object+"を"+action+"します…!";}}// --></script></head><body style="color:red;background-color:black; font-size:30px; text-align:center;"></body></html>
javascriptでスーパークラスのメソッドを簡単に呼び出したかった。それだけだった。
var Class = inherit(SuperClass,{hoge: ...});
作ったクラスはprototypeに、第二引数のオブジェクトがコピーされたスーパークラスのインスタンスを持つ。
第一引数がnullだと、スーパークラスにObjectを用いる。つまり、
var Class = inherit(null,{hoge: ...});
は
var Class = inherit(Object,{hoge: ...});
と同等となる。
また、第一引数が"prototype"をメンバに持たない普通のオブジェクト、つまり、
var Class = inherit({hoge: ...});
だと
var Class = inherit(Object,{hoge: ...});
と同等となる。
var obj =new Class({hoge: ...});
でインスタンスを作ると、引数のオブジェクトのコピーを持つオブジェクトとなる。
また、メソッド"initialize"が自動的に実行される。
ただし、コンストラクタに引数を渡さなかった場合は、initializeは実行されない。
this.superapply(arguments);
としてスーパークラスのメソッドを呼べる。第一引数は呼び出すメソッドの引数の配列とする。
このとき、呼び出し側のメソッドはコンストラクタやinheritでオーバーライドしたメソッドでなくてはならない。これは呼び出し側のメソッド名を記録する必要があるためである。
そうでない場合は第二引数にメソッド名を渡す必要がある。
var obj =new Class({});obj.foo =function(){this.superapply(arguments);// Xthis.superapply(arguments,"foo");// O};
<html><head><script type="text/javascript">function inherit(superclass, override){if (!superclass)superclass =Object;if (!"prototype" in superclass){override = superclass;superclass =Object;}var that;var func;function superapply(arg,name){var prev ={that: that, func: func};try{var my =this.superapply;if (!arg)arg = [];if (!name)name = arguments.callee.caller.caller.methodName;if (that && func && (!name ||name == func.methodName)){that = that.superapply.obj;name = func.methodName;}elseif (name){that = my.obj;func = arguments.callee.caller.caller;func.methodName =name;}else{thrownew Error("methodName is null");}var result;if (func === that[name]){result =this.superapply(arg,name);}else{func = that[name];func.methodName =name;result = func.apply(this, arg);}} finally{that = prev.that;func = prev.func;}return result;};varprototype =new superclass();prototype.superapply =function(){superapply.apply(this, arguments)};prototype.superapply.obj = superclass.prototype;if (override)for (var i in override){prototype[i] = override[i];if (typeof override[i] =="function")prototype[i].methodName = i;}var subclass =function(obj){this.superapply =function(){superapply.apply(this, arguments)};this.superapply.obj =prototype;if (obj){for (var i in obj){this[i] = obj[i];if (typeof obj[i] =="function")this[i].methodName = i;}this.initialize();}};subclass.prototype =prototype;subclass.prototype.constructor = subclass;return subclass;}var C1 = inherit(Object,{fn:"C1",initialize:function(){alert("C1.initialize");this.second(this.fn);},second:function(a){alert("C1.second: "+a);}});var C2 = inherit(C1,{fn:"C2",initialize:function(){alert("C2.initialize");this.superapply();//},//second://function(a){//alert("C2.second: "+a);//this.superapply([a]);}});varC3 =new C2({fn:"C3",//initialize://function(){//alert("C3.initialize");//this.superapply();//},second:function(a){alert("C3.second: "+a);this.superapply([a]);}});</script></head><body></body><html>
methodNameなんとかならんもんか。
でも俺もmake sureなんていわれたらトドメさしちゃうよ。
make sureなんてこういう場合つかわねぇよな??
べりふぃうんちゃらとかこんしだーとかつかうんじゃねぇの?
それより想像力豊かなおいらは
A couple of New Jersey hunters are out in the woods whenone of them
falls tothe ground. He doesn't seem to be breathing,his eyes are
rolled back inhishead. The otherguy whips outhiscell phone and
calls the emergency services. He gasps to the operator: “Myfriend is
dead! Whatcan I do?” The operator, in acalm soothingvoice says:
“Justtake it easy. Ican help. First, let'smake sure he's dead.”
There is a silence, then a shot is heard.The guy'svoice comes back
on the line. He says: “OK,now what?"
以下の二つに留意、つまり乱用禁止。
取説未満
// ==UserScript==// @nameanond pickup of the day// @namespacehttp://anond.hatelabo.jp/// @descriptionpickup section of the dayat Hatelabo::AnonymousDiary// @includehttp://anond.hatelabo.jp/2*// ==/UserScript==(function(){var trackbackThreshold = 10;var ignoreList = {"/20070801172335": 33,"/20070806163721": 10,};// only section of the dayif (! location.pathname.match(/^\/\d{8}$/)) {return;}// regist ancher that kick main routinevar 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;")+"] "+'<ahref="http://b.hatena.ne.jp/entry/http://anond.hatelabo.jp/'+sectionName+'">'+'<imgsrc="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 ='<ahref="#'+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();functionCC(day) {this.li = document.createElement("li");this.li.innerHTML = '<ahref="/'+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 = '<ahref="/'+this.day+'" target="_blank">' + this.day + "</a> " + this.n.length;} else {this.li.innerHTML += ' <ahref="/'+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 {varcc = newCC(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) {varid = section.getElementsByTagName("h3")[0].firstChild.pathname.replace(/\//,"");vartoday =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();functionHide(){}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 = newObject();this.a.visible = document.createElement("a");this.a.visible.id = "visible";this.a.visible.href = "#";this.a.visible.innerHTML = "visiblehide 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 = "unvisiblehide 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/);}varhide = newHide();// main routinefunction grab(){if (! document.body.innerHTML.match(/<div class="pager-r">(\d+)/)) {return;}varpages =RegExp.$1 -0;if (pages <= 0 ||pages > 40) { // check error and limit 1000 entryreturn;}//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 concatenatefunction 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 sectionat last cat() concatenate afterfunction 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));}vartbs = document.evaluate("//p[@class='sectionfooter']/a[2]",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for (var i=0; i<tbs.snapshotLength; i++) {vartb =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 trackbacksfunctiontrackback(tb) {GM_xmlhttpRequest({method: "GET",url: "http://anond.hatelabo.jp/" +tb.pathname.match(/\d{14}/),onload: function(result) {varlink = result.responseText.match(/<aname="tb">(.|\s)*/)[0].match(/<li>\s*<ahref="http:\/\/anond.hatelabo.jp\/\d{14}"/g);var n =link.length;for (var l inlink) {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);}}});}})();