HomeGenie Forum
Development => Bug reporting => Topic started 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.
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.
-
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.
-
I was able to get it working by adding APPID api key to the webserviceurl:
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.
-
Strange. I tried that first and it didn't work.
-
I've updated the program with an option to set the API key, see attached file.
Perhaps somebody can upload it to GitHub?
-
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 :)