超高速del.icio.usポスト用bookmarklet その名も "atode"

http://d.hatena.ne.jp/taizooo/20060428/1146239311

http://la.ma.la/misc/js/delicious_bookmarklet.html
"atode"というタグをつけて一発ブックマークするブックマークレットをつくった.
こんなん.

まあいいや、というわけで escape() を encodeURIComponent() に置換してみた.正しいかどうかわからんけども、化けなくなった.めでたしめでたし.

javascript:
(function(){
var%20u=%22taizooo%22;
var%20q=location.href;
var%20e%20=%20%22%22%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection?document.getSelection():document.selection.createRange().text);
var%20p=document.title;
var%20url=%22http://del.icio.us/%22+u+%22?jump=doclose&tags=%22+encodeURIComponent(%22atode%22)+%22&url=%22+encodeURIComponent(q)+%22&description=%22+encodeURIComponent(p)+%20%20%22&extended=%22%20+%20encodeURIComponent(e).replace(/%20/g,%20%22+%22);
(new%20Image).src=url
})();


これを、

  1. 識別タグ(atode)
  2. 日付タグ(2006/05/01)
  3. 月タグ(2006/05)

をつけるように改造したい.

追記:xxx yyy zzz という風にタグを複数登録する場合

javascript:
(function(){
var%20u=%22taizooo%22;
var%20q=location.href;
var%20e%20=%20%22%22%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection?document.getSelection():document.selection.createRange().text);
var%20p=document.title;
var%20url=%22http://del.icio.us/%22+u+%22?jump=doclose&tags=%22+escape(%22xxx%20yyy%20zzz%22)+%22&url=%22+escape(q)+%22&description=%22+escape(p)+%20%20%22&extended=%22%20+%20escape(e).replace(/%20/g,%20%22+%22);
(new%20Image).src=url
})();
escape(%22xxx%20yyy%20zzz%22) 

という風にスペース(%20)で区切って記述する.
実際にはescape() ---> encodeURIComponent() しないと、日本語バケバケ.

追記:2006/06/28 window開いて閉じるタイプ

javascript:(function(){var%20u=%22taizooo%22;var%20q=location.href;var%20e%20=%20%22%22%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection?document.getSelection():document.selection.createRange().text);var%20p=document.title;var%20url=%22http://del.icio.us/%22+u+%22?jump=doclose&tags=%22+escape(%22atode%22)+%22&url=%22+escape(q)+%22&description=%22+escape(p)+%20%20%22&extended=%22%20+%20escape(e).replace(/%20/g,%20%22+%22);window.open(url)})();


これの escape() ---> encodeURIComponent() 版はこちら

javascript:(function(){var%20u=%22taizooo%22;var%20q=location.href;var%20e%20=%20%22%22%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection?document.getSelection():document.selection.createRange().text);var%20p=document.title;var%20url=%22http://del.icio.us/%22+u+%22?jump=doclose&tags=%22+encodeURIComponent(%22atode%22)+%22&url=%22+encodeURIComponent(q)+%22&description=%22+encodeURIComponent(p)+%20%20%22&extended=%22%20+%20encodeURIComponent(e).replace(/%20/g,%20%22+%22);window.open(url)})();

追記:2006/06/28 なんか del.icio.us で、このスクリプトがウマク動かなくなった

ので、jump=doclose& をとっぱらってみた.

javascript:(function(){var%20u=%22taizooo%22;var%20q=location.href;var%20e%20=%20%22%22%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection?document.getSelection():document.selection.createRange().text);var%20p=document.title;var%20url=%22http://del.icio.us/%22+u+%22?tags=%22+encodeURIComponent(%22atode%22)+%22&url=%22+encodeURIComponent(q)+%22&description=%22+encodeURIComponent(p)+%20%20%22&extended=%22%20+%20encodeURIComponent(e).replace(/%20/g,%20%22+%22);window.open(url)})();


でもやっぱりだめでした.こんなアラートがでます.

Sorry, please try again.
A required security token was not received with your form data.
Trying again should fix it. If the problem persists please contact support@del.icio.us. Thanks!