家畜同然

合い挽き肉におけるビーフの割合

今日は何の日 フッフゥ~♪

今日は何の日~毎日が記念日~
http://www.nnh.to/

今日は何の日かをネタにしてブログを書く時、このサイトをよく見てるんだけど該当日のURL(ページ)にいちいち飛ばなきゃいけないのが面倒臭いんだよね。見たい日付のページに行くまでに2回クリックが要る。

そこで、書いた。

myD       = new Date();

myMonth   = myD.getMonth() + 1;
myDate    = myD.getDate();

myMonth = "0" + myMonth;
myDate = "0" + myDate;

url = "http://www.nnh.to/" + myMonth.substr(-2) + "/" + myDate.substr(-2) + ".html";

setTimeout("link()", 0);
function link(){
location.href=url;
}

http://www.nnh.to/ のあとに 数字2桁で月 / 数字2桁で日 .html
これで好きな日付のページに飛べる!因みに10月18日は「フラフープ記念日」らしいので、今日一日中回しまくって腸捻転になりましょう。

さておき

sprintf関数なら

sprintf("%02d", hoge)

で出来るけど、Javascriptにないから「0」を文字列としてくっつけて

myMonth = "0" + myMonth;

お尻から2桁を表示する

myMonth.substr(-2)

で対応してみた。

あとはブラウザのお気に入り編集で、この余分な余白とか改行をギュッとしたバージョン↓をURL欄にぶち込めば、当日の「今日は何の日」ページへ飛ぶことができる!なんて日だ!

javascript:myD = new Date();myMonth = myD.getMonth() + 1;myDate = myD.getDate();myMonth = "0" + myMonth;myDate = "0" + myDate;url = "http://www.nnh.to/" + myMonth.substr(-2) + "/" + myDate.substr(-2) + ".html";setTimeout("link()", 0);function link(){location.href=url;}

「今日は何の日 フッフゥ~♪」が脳内再生余裕な人は、手を挙げてください。