LoginSignup
0
0

More than 3 years have passed since last update.

逃げるURL、追うブックマークレット

Last updated at Posted at 2019-08-18

棋士の藤井聡太七段は気象庁のWebページで積雪深の情報を見るのが好きだそうですが、私は真夏に気温の高さを確認する癖があったりします。

気象庁の過去データというので、月単位で1日単位のデータを見ることができます。それをブックマークするのですが、しばらく日が経って(時には1年経って)ブックマークを利用してアクセスすると、ブックマークしたときの月のデータが表示されます。

(ちなみに、ブックマークした2017年7月の気象データ

こ、これは不便だ……ということで、ブックマークレットを使ってみました。

javascript:
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth();
month++;
location.href = 'http://www.data.jma.go.jp/obd/stats/etrn/view/daily_s1.php?prec_no=44&block_no=47662&year='+year+'&month='+month+'&day=&view=p1';

使い方としては、

image.png

Javascriptのプログラムを ブックマークのURLのところに書く だけ。

いやー、これで当該月の気象データを確認することができます。とても便利ですね。

ちなみに東京、7月26日から25.0度を下回っておりません。常に熱帯夜。暑すぎます :sweat_drops:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0