Open timuckun opened 3 years ago
After 3pm for whatever station your pulling data from, datepart[0] is null, and I have found no way to retrieve today's icon at that point. I think this is a weird feature to have with the wunderground API, but I can only work with what I have. Unfortunately that means tomorrow's icon. If you find a way still retrieve the icon for today after 3pm, I will be happy to implement it in the code base.
Interesting.
Two ideas...
Caching data locally wont really work, as you have to visit the page sometime before 3 for it to even exist in the cache. If the first time you visit the page is after 3, then your still in the same boat.
Fetching the conditions from the nearest local station that would have the icon, would be a timezone away, and thus even more inaccurate. It's the 3pm issue again.
The full API can be found here: https://docs.google.com/document/d/1eKCnKXI9xnoMGRRzOL1xPCBihNV2rOet08qpE_gArAY/edit There is no icon associated with current conditions, and I have to pull that from the forecast. I have no idea, why there is no icon with the current conditions, and I haven't been able to figure out where wunderground itself is pulling the current conditions icon.
I set up three different locations on my WU page and watched the console for XHR requests. I did see a bunch of these.
https://api.weather.com/v3/location/near? apiKey=6532d6454b8aa370768e63d6ba5a832e& geocode=-37.717%2C175.994& product=airport& subproduct=major&format=json
and
https://api.weather.com/v3/location/point? apiKey=6532d6454b8aa370768e63d6ba5a832e& language=en-US&geocode=-37.737%2C175.981&format=json
These are undocumented in the PWS api document and I haven't tried them yet myself but I plan on doing some experiments to see where it gets me.
Hi.
Looking at the code and the return from the wunderground API the datepart[0] are null every time I pull them so it looks like it's always showing tomorrow's icon. Am I reading the code wrong or misunderstanding the returned data?
Thanks.