Open karlhungus opened 6 years ago
I too noticed this problem. Looks like weathernderground requires a country code to explicitly resolve a city. For example there are Londons in several countries. Omitting the country code still generates a json file with all of the available city options, but this does not include the actual conditions fields, so you always get a zero for the temp.
The url should look something like this (for Japanese cities):
url := "https://api.wunderground.com/api/" + w.apiKey + "/conditions/q/JP/" + city + ".json"
I can't say that I took the time to review the API docs to see if there is a way to have weatherunderground automatically pick the best one.
Might be worth updating your post which is very good to note:
~(and you probably shouldn't store them in version control)~ #-- you do this in your codeAn example of how to call it now: https://github.com/karlhungus/dweeb/blob/0f1f795e9c301a89916e5a6d25d5e375de1aefdf/weather.go#L47