{"id":259,"date":"2018-04-03T09:05:06","date_gmt":"2018-04-03T00:05:06","guid":{"rendered":"http:\/\/hmac.no-ip.com\/livevideo\/?page_id=259"},"modified":"2026-09-15T06:20:30","modified_gmt":"2026-09-14T21:20:30","slug":"%e3%83%a9%e3%82%a4%e3%83%96%e8%90%bd%e9%99%bd%e3%83%86%e3%82%b9%e3%83%88","status":"publish","type":"page","link":"https:\/\/oshima-live.com\/livevideo\/?page_id=259","title":{"rendered":"\u30d3\u30c7\u30aa\u6c34\u5e73\u7dda"},"content":{"rendered":"\n<div id=\"today-info\" style=\"font-size:1.1em; line-height:1.6;\"><\/div>\n\n<script src=\"https:\/\/unpkg.com\/suncalc@1.9.0\/suncalc.js\"><\/script>\n<script>\n  const lat = 36.250;\n  const lon = 136.100;\n\n  const now = new Date();\n  const weeks = ['\u65e5','\u6708','\u706b','\u6c34','\u6728','\u91d1','\u571f'];\n\n  const dateStr =\n    now.getFullYear() + '\u5e74' +\n    (now.getMonth()+1) + '\u6708' +\n    now.getDate() + '\u65e5\uff08' +\n    weeks[now.getDay()] + '\uff09';\n\n  const times = SunCalc.getTimes(now, lat, lon);\n\n  function fmt(d){\n    return d.getHours().toString().padStart(2,'0') + ':' +\n           d.getMinutes().toString().padStart(2,'0');\n  }\n\n  const weatherURL =\n    `https:\/\/api.open-meteo.com\/v1\/forecast?latitude=${lat}&longitude=${lon}` +\n    `&current=temperature_2m,relative_humidity_2m` +\n    `&hourly=cloud_cover,precipitation_probability,weather_code` +\n    `&timezone=Asia\/Tokyo`;\n\n  fetch(weatherURL)\n    .then(res => res.json())\n    .then(data => {\n\n      const temp = data.current.temperature_2m;\n      const humi = data.current.relative_humidity_2m;\n\n      \/*\n       * \u65e5\u6ca130\u5206\u524d\uff5e\u65e5\u6ca130\u5206\u5f8c\u306e\n       * \u96f2\u91cf\u30fb\u964d\u6c34\u78ba\u7387\u3092\u8abf\u3079\u308b\n       *\/\n\n      const sunset = times.sunset;\n\n      let cloudValues = [];\n      let rainValues = [];\n\n      data.hourly.time.forEach((t, i) => {\n\n        const time = new Date(t);\n\n        const diff = (time.getTime() - sunset.getTime()) \/ 60000;\n\n        \/\/ \u65e5\u6ca130\u5206\u524d\uff5e\u65e5\u6ca130\u5206\u5f8c\n        if (diff >= -30 && diff <= 30) {\n\n          cloudValues.push(data.hourly.cloud_cover[i]);\n          rainValues.push(\n            data.hourly.precipitation_probability[i]\n          );\n        }\n      });\n\n      \/\/ \u5e73\u5747\u5024\u3092\u8a08\u7b97\n      const average = arr =>\n        arr.length\n          ? arr.reduce((a,b) => a+b, 0) \/ arr.length\n          : 100;\n\n      const cloud = average(cloudValues);\n      const rain = Math.max(...rainValues);\n\n      \/*\n       * \u5915\u65e5\u671f\u5f85\u5ea6\n       *\/\n\n      let stars;\n      let comment;\n\n      if (rain >= 60) {\n\n        stars = '\u2605\u2606\u2606\u2606\u2606';\n        comment = '\u96e8\u306e\u53ef\u80fd\u6027\u304c\u9ad8\u304f\u3001\u5915\u65e5\u306f\u671f\u5f85\u8584\u3067\u3059';\n\n      } else if (cloud <= 20) {\n\n        stars = '\u2605\u2605\u2605\u2605\u2606';\n        comment = '\u897f\u306e\u7a7a\u304c\u304b\u306a\u308a\u958b\u3051\u3066\u3044\u3066\u3001\u5915\u65e5\u304c\u671f\u5f85\u3067\u304d\u305d\u3046\u3067\u3059';\n\n      } else if (cloud <= 40) {\n\n        stars = '\u2605\u2605\u2605\u2605\u2605';\n        comment = '\u9069\u5ea6\u306a\u96f2\u304c\u3042\u308a\u3001\u304d\u308c\u3044\u306a\u5915\u713c\u3051\u304c\u671f\u5f85\u3067\u304d\u305d\u3046\u3067\u3059';\n\n      } else if (cloud <= 60) {\n\n        stars = '\u2605\u2605\u2605\u2606\u2606';\n        comment = '\u96f2\u306e\u5207\u308c\u9593\u304b\u3089\u5915\u65e5\u304c\u898b\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059';\n\n      } else if (cloud <= 80) {\n\n        stars = '\u2605\u2605\u2606\u2606\u2606';\n        comment = '\u96f2\u304c\u591a\u304f\u3001\u5915\u65e5\u306f\u5c11\u3057\u671f\u5f85\u8584\u3067\u3059';\n\n      } else {\n\n        stars = '\u2605\u2606\u2606\u2606\u2606';\n        comment = '\u96f2\u304c\u304b\u306a\u308a\u591a\u304f\u3001\u5915\u65e5\u306f\u671f\u5f85\u8584\u3067\u3059';\n      }\n\n      document.getElementById(\"today-info\").innerHTML =\n  '\ud83d\udcc5 ' + dateStr + '<br>' +\n  '\ud83c\udf21 ' + temp + '\u2103 \uff0f \ud83d\udca7 ' + humi + '\uff05<br>' +\n  '\ud83c\udf05 \u65e5\u306e\u51fa\uff1a' + fmt(times.sunrise) + '<br>' +\n  '\ud83c\udf07 \u65e5\u306e\u5165\u308a\uff1a' + fmt(times.sunset) +\n  '\u3000<b>\u5915\u65e5\u671f\u5f85\u5ea6\uff1a' + stars + '<\/b>' +\n  '\u3000' + comment;\n    })\n    .catch(error => {\n      console.error(error);\n    });\n<\/script>\n\n\n\n<figure class=\"wp-block-video\"><video controls=\"\" src=\"https:\/\/oshima-live.com\/sunset_new.mp4\" width=\"1024\" height=\"768\" autoplay=\"\" loop=\"\"><\/video><\/figure>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/oshima-live.com\/livevideo\/rakuyou.php\" width=\"1000\" height=\"30\" frameborder=\"0\"><\/iframe>\n\n\n<div id=\"pl-gb259-6ac41dcbbdafd\"  class=\"panel-layout\" ><div id=\"pg-gb259-6ac41dcbbdafd-0\"  class=\"panel-grid panel-no-style\" ><div id=\"pgc-gb259-6ac41dcbbdafd-0-0\"  class=\"panel-grid-cell\" ><div id=\"panel-gb259-6ac41dcbbdafd-0-0-0\" class=\"so-panel widget panel-first-child panel-last-child\" data-index=\"0\" ><\/div><\/div><div id=\"pgc-gb259-6ac41dcbbdafd-0-1\"  class=\"panel-grid-cell\" ><div id=\"panel-gb259-6ac41dcbbdafd-0-1-0\" class=\"so-panel widget panel-first-child panel-last-child\" data-index=\"1\" ><\/div><\/div><div id=\"pgc-gb259-6ac41dcbbdafd-0-2\"  class=\"panel-grid-cell\" ><div id=\"panel-gb259-6ac41dcbbdafd-0-2-0\" class=\"so-panel widget panel-first-child panel-last-child\" data-index=\"2\" ><\/div><\/div><div id=\"pgc-gb259-6ac41dcbbdafd-0-3\"  class=\"panel-grid-cell\" ><div id=\"panel-gb259-6ac41dcbbdafd-0-3-0\" class=\"so-panel widget panel-first-child panel-last-child\" data-index=\"3\" ><\/div><\/div><\/div><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-259","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=\/wp\/v2\/pages\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":2,"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=\/wp\/v2\/pages\/259\/revisions"}],"predecessor-version":[{"id":4487,"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=\/wp\/v2\/pages\/259\/revisions\/4487"}],"wp:attachment":[{"href":"https:\/\/oshima-live.com\/livevideo\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}