はてなダイアリーTools(私家版)

javascript:〜」で始まる文字列をブラウザのアドレス欄にコピーするか、またはブックマークに登録してお試し下さい。IE6.0およびFirefox1.0、Opera8.0で動作を確認済みです。コピー&ペーストでは使いにくいので独立ページを作りました

  • 選択中の文字列または閲覧中のURLに含まれるISBN(に対応する本)をコレクションに登録するjavascript:(function(s){try{s=document.selection.createRange().text}catch(e){s=document.getSelection()}(s+document.URL).replace(/-/g,'').replace(/(?:^|[^\dX])([\dX]{10})(?=$|[^\dX])/g,function(s,t){open('http:'+'//b.hatena.ne.jp/add?mode=confirm&url=http%3A%2F%2Fd.hatena.ne.jp%2Fasin%2F'+t,'_blank')})})()
  • 閲覧中のダイアリーを(ヘルプのような)見出し単位の開閉式にする:javascript:(function(i){with(document.getElementsByTagName('DIV')){for(i=0;i<length;++i){with(item(i)){if(className=='section'){(function(o,x){if(o){if(o.tagName=='H3'){o.style.borderWidth='thin';(o.onclick=function(){o.style.borderStyle=(x=!x)?'outset':'inset';(function(o){if(o&&o.tagName!='H3'){if(o.style){o.style.display=x?'none':'block'}arguments.callee(o.nextSibling)}})(o.nextSibling)})()}arguments.callee(o.nextSibling)}})(firstChild)}}}}})()
  • 閲覧中のダイアリーのコメント表示欄(トラックバックリンク元)を開閉式にする:javascript:(function(i){with(document.getElementsByTagName('DIV')){for(i=0;i<length;++i){with(item(i)){if(className=='comment'||className=='refererlist'){(function(o,x){if(o){if(o.className=='caption'){o.style.borderWidth='thin';(o.onclick=function(){o.style.borderStyle=(x=!x)?'outset':'inset';(function(o){if(o&&o.className!='caption'){if(o.style){o.style.display=x?'none':'block'}arguments.callee(o.nextSibling)}})(o.nextSibling)})()}arguments.callee(o.nextSibling)}})(firstChild)}}}}})()
  • 閲覧中のダイアリーのコメント投稿欄(トラックバックリンク元)をまとめて開く*1javascript:with(location){assign(protocol+'//'+host+(pathname+search).replace(/^(\/[\w-]{3,15}\/)(|\d{6,8})(?:\/\w+)?)((?:\?.*)?)$/,function(s,t,u,v){return(t+'comment'+(v?u?v+'&date='+u:v:u?'?date='+u:''))(})+hash)}
  • 閲覧中のダイアリーのコメント表示欄に含まれるURLをリンクにする:javascript:(function(i){with(document.getElementsByTagName('DIV')){for(i=0;i<length;++i){with(item(i)){if(className=='commentshort'){innerHTML=innerHTML.replace(/\u300e.*\u300f/g,function(s){return(s.replace(/s?https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:@&=+$,%#]+/g,function(s){try{return(decodeURIComponent(s).link(s))}catch(e){return(s.link(s))}}))})}}}}})()
  • 閲覧中のアンテナに含まれるリンク先からリダイレクタ(http://a.hatena.ne.jp/go?〜)を外す:javascript:(function(i){with(document){for(i=0;i<links.length;++i){with(links[i]){href=href.replace(/^http:\/\/a\.hatena\.ne\.jp\/go\?(.*)\d{14}$/,'$1')}}}})()
  • 閲覧中のアンテナで捕捉しているサイトをサムネイル表示する*2javascript:(function(i,v){with(document){v=[];for(i=0;i<links.length;++i){if(links[i].href.match(/^http:\/\/a\.hatena\.ne\.jp\/go\?(.*)\d{14}$/)){v.push(RegExp.$1)}}for(i=0;i<v.length;++i){with(body.insertBefore(createElement('A'),getElementsByTagName('H1')[0])){href=v[i];target='_blank';with(appendChild(createElement('IMG'))){src='http:'+'//thumbnails.alexa.com/image_server.cgi?size=small&url='+v[i];hspace=vspace=4;width=112;height=82}}}}})()
  • 閲覧中の人力検索の質問文に含まれるURLをリンクにする:javascript:with(document.getElementsByTagName('DIV')[0].getElementsByTagName('FONT')[0]){void(innerHTML=innerHTML.replace(/s?https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:@&=+$,%#]+/g,function(s){try{return(decodeURIComponent(s).link(s))}catch(e){return(s.link(s))}}))}公式に対応されました*3

*1:日記内検索結果の一覧表示中は使えません。

*2:ただし、マイナーなサイトは「PICTURE COMMING SOON」になると思います。画像はhttp://thumbnails.alexa.com/update_thumbnailより更新可能です。

*3:アナウンス:g:hatena:id:hatena:20050512:1115871286