Having posted my Highly Inappropriate Quote Generator recently, I decided to go ahead and tackle the Weather App next. It’s a pretty basic challenge that I thought had some room for fun in it.
I went a bit beyond what was called for the in the challenge - I wanted to try some things out and see if I could make something interesting. So in the end I put together a page which incorporates a gallery of cities from around the world - 10 of them in all, spread across the planet. You can click the cities to look up their current weather. Additionally, you can manually input a city name from anywhere in the world to see it’s weather as well. You’ll get a simple four day forecast and the ability to open up the city you are viewing in google maps.
The interface incorporates some very nice royalty free weather iconography I found during the research side of this. I’ll have to look up the artist’s name - I think they did a very nice job and deserve credit!
In the end, I ended up including 5 different, APIs I believe. (Part of what I wanted to do with this was work with a number of APIs to generate a final result).
1.) OpenWeather API for current weather and forecast.
2.) Sunrise-Sunset.org for Sunrise and sunset times by lat/long
3.) Google geocode for easily getting lat/long for locations by name.
4.) Google timezone for getting timezone offsets for lat/long so that I could display appropriate times (and calculate is_daylight/dawn/dusk values).
5.) And finally freegeoip.net for ipaddress based location services which I put it at the last minute because Google now blocks location access from insecure connections. But that service works pretty poorly - they place me 120 miles from where I live! If you use Firefox, it still uses the internal geolocation API which is quite accurate.
I had some more plans for this little app, but I’m supposed to be working on other things, I think I’d better call this done.
I’d really appreciate a look and any feedback - I’ve tested this on FF and Chrome and on my Android phone and it seems to be working well.
You can see it at: