Skip to content

Instantly share code, notes, and snippets.

@amuradyan
Created May 21, 2022 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amuradyan/d8b9d620e5dabd7952956da44311d3e8 to your computer and use it in GitHub Desktop.
Save amuradyan/d8b9d620e5dabd7952956da44311d3e8 to your computer and use it in GitHub Desktop.

weatherapi, among other things, provides a REST API for historical weather data. You need to look into the historical data of five days for a given city from a given date and calculate the average wind speed in meters per second, the average humidity and the average temperature in kelvins for each of these days.

Your application should provide and HTTP GET endpoint named stats, that should accept two parameters: the date in the format YYYY-MM-DD and the city name. The communication should be done via JSON.

For the HTTP server, you should use Akka HTTP. For the json parsing, you should use play-json. sbt should be used to build the application and scalatest to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment