Skip to content

Commit

Permalink
OpenWeathermap version 3.0 one call api mattrossman#71
Browse files Browse the repository at this point in the history
mattrossman#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 :-(
  • Loading branch information
clach04 authored Mar 27, 2024
1 parent ae669d0 commit a7ae4a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pkjs/weather/openweathermap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -81,4 +81,4 @@ OpenWeatherMapProvider.prototype.withProviderData = function (lat, lon, callback
}).bind(this))
}

module.exports = OpenWeatherMapProvider;
module.exports = OpenWeatherMapProvider;

0 comments on commit a7ae4a2

Please sign in to comment.