HomeGenie Forum

Development => Bug reporting => Topic started by: bkenobi on October 17, 2015, 07:13:07 PM

Title: jkUtils - OpenWeatherData requires API key
Post by: bkenobi on October 17, 2015, 07:13:07 PM
It appears that OpenWeatherData has changed their API such that it now requires an API key.  I have not received data in a few days and manually entered the URL into firefox.

Code: [Select]
Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.
I have not checked into obtaining an API key yet, but I assume it's free for private use.
Title: Re: jkUtils - OpenWeatherData requires API key
Post by: bkenobi on October 18, 2015, 05:43:51 PM
The API key is free for personal use.  It appears that it can only be used so many times in a period as I started to receive errors after a bit of testing.  It also appears that the response data may not be the same format as what OpenWeatherMap used to reply with since updating the URL to a valid one including APIkey did not get things functioning again.  If someone that knows more about this code were to take a look, it would probably be an easy fix.  I don't know what the response used to be, so I'm not sure how to fix the code myself.
Title: Re: jkUtils - OpenWeatherData requires API key
Post by: kevin1 on October 21, 2015, 05:37:19 PM
I was able to get it working by adding APPID api key to the webserviceurl:

Code: [Select]
  string webserviceurl = "http://api.OpenWeatherMap.org/data/2.5/weather?q="+ location +"&lang=" + language+"&appid=" + apikey;
I didn't request an API key yet, but found working one for testing in the URL for the example here: http://openweathermap.org/current#name (http://openweathermap.org/current#name)

So it seems the JSON response parameters are the same, my widget has updated.
Title: Re: jkUtils - OpenWeatherData requires API key
Post by: bkenobi on October 21, 2015, 05:56:29 PM
Strange.  I tried that first and it didn't work.
Title: Re: jkUtils - OpenWeatherData requires API key
Post by: gbremmer on May 01, 2017, 01:48:14 PM
I've updated the program with an option to set the API key, see attached file.
Perhaps somebody can upload it to GitHub?
Title: Re: jkUtils - OpenWeatherData requires API key
Post by: [email protected] on May 30, 2017, 02:58:59 PM
I need just this so have created a pull request for the changed module - I have however set the enabled flag back to the existing package state, mainly as it is a pet hate for programs to be enabled by default :)