ニコニコ動画の再生ページに天気情報を表示するGreasemonkey
今日新しく再生ページに天気の情報が埋め込まれていたので、それを元に天気情報を表示するGreasemonkeyを作ってみた。
- ニコニコ動画の再生ページに埋め込まれている情報 | Web scratch
- http://efcl.info/2008/1206/res369/
多分プレイヤーに天気を表示する部分が出来るのだろうと思う。
(是非ON/OFFできるようにして下さい。)
// ==UserScript==
// @name nico weather news
// @namespace http://efcl.info/
// @description ニコニコ動画再生ページの天気情報を表示
// @include http://www.nicovideo.jp/watch/*
// ==/UserScript==
(function(){
const weather1 = unsafeWindow.so.variables.weather1;
const conjunction = unsafeWindow.so.variables.conjunction;
const weather2 = unsafeWindow.so.variables.weather2;
const highest_temperature = unsafeWindow.so.variables.highest_temperature;
const lowest_temperature = unsafeWindow.so.variables.lowest_temperature;
const chance_of_rain = unsafeWindow.so.variables.chance_of_rain;
var Cweather1 = (weather1) ? weather1 : "";
var Cconjunction = (conjunction) ? conjunction : "";
var Cweather2 = (weather2) ? weather2 : "";
var Chighest_temperature = (highest_temperature) ? " \u6700\u9ad8:"+highest_temperature : "";
var Clowest_temperature = (lowest_temperature) ? " \u6700\u4f4e:"+lowest_temperature : "";
var Cchance_of_rain = (chance_of_rain) ? " \u964d\u6c34\u78ba\u7387:"+chance_of_rain : "";
var temp = "" + Chighest_temperature + "/"
+ Clowest_temperature + "";
var weather_news = Cweather1 + Cconjunction + Cweather2 + temp + Cchance_of_rain;
//GM_log(weather_news);
var weatherbox = document.createElement("div");
weatherbox.innerHTML = decodeURI(weather_news);
document.getElementById("WATCHHEADER").appendChild(weatherbox);
})();
Related posts:






