From a7ae4a2b562d15ff344182c425740065290dff12 Mon Sep 17 00:00:00 2001 From: clach04 Date: Tue, 26 Mar 2024 17:43:46 -0700 Subject: [PATCH] OpenWeathermap version 3.0 one call api #71 https://github.com/mattrossman/forecaswatch2/issues/71 https://openweathermap.org/api/one-call-api claims: > One Call API 2.5 will be deprecated on April 15, 2024. It is NOT working today, a few weeks before that date :-( --- src/pkjs/weather/openweathermap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkjs/weather/openweathermap.js b/src/pkjs/weather/openweathermap.js index 69baf4b..1ab2574 100644 --- a/src/pkjs/weather/openweathermap.js +++ b/src/pkjs/weather/openweathermap.js @@ -23,7 +23,7 @@ OpenWeatherMapProvider.prototype.constructor = OpenWeatherMapProvider; OpenWeatherMapProvider.prototype._super = WeatherProvider; OpenWeatherMapProvider.prototype.withOwmResponse = function (lat, lon, callback) { - var url = 'https://api.openweathermap.org/data/2.5/onecall?appid=' + this.apiKey + '&lat=' + lat + '&lon=' + lon + '&units=imperial&exclude=alerts,minutely'; + var url = 'https://api.openweathermap.org/data/3.0/onecall?appid=' + this.apiKey + '&lat=' + lat + '&lon=' + lon + '&units=imperial&exclude=alerts,minutely'; request(url, 'GET', function (response) { var weatherData = JSON.parse(response); console.log('Found timezone: ' + weatherData.timezone); @@ -81,4 +81,4 @@ OpenWeatherMapProvider.prototype.withProviderData = function (lat, lon, callback }).bind(this)) } -module.exports = OpenWeatherMapProvider; \ No newline at end of file +module.exports = OpenWeatherMapProvider;