For this project, I wanted the user to be able to input as many locations as they wanted and recieve a table showing the weather for each location. This would make comparing weather in several locations trivial. I decided to use java for the project because of the easy to use Apache POI library for generating xlsx files, and because of its platform independence.
One unique aspect of this project is the "Should I go biking?" row which determines how suitable the weather in each location is for a ride based on amount of precipitation, wind speed, and temperature.
- pulls data for each specified location
- current weather information
- high and low temperatures of the day
- bikeability for the day
- time of sunrise and sunset
- outputs an excel sheet containing weather data
- get current moon phase
- write unit tests
obtain or generate an API key for Google's Geolocation API
- to generate a key, follow the instructions here
run with jarfile (Windows)
$env:GEOLOCATION_API_KEY="GOOGLE_GEOLOCATION_KEY" ; java -jar kata.jar "San Diego" "San Francisco" "Los Angeles" "Sacramento"
run with jarfile (Unix)
GEOLOCATION_API_KEY="GOOGLE_GEOLOCATION_KEY" java -jar kata.jar "San Diego" "San Francisco" "Los Angeles" "Sacramento"
run with gradle
GEOLOCATION_API_KEY="GOOGLE_GEOLOCATION_KEY" gradle run --args="milwaukee madison 'green bay' chicago antarctica"
Note
One benefit of using Google's Geolocation API is that locations can be as specific as a street address or as general as a continent!
- open-meteo api
- google's geolocation api
- apache poi
- LatLongToTimezone for timezone calculations (TimezoneMapper.java)
- WMO descriptions (descriptions.json)