themillhousegroup / bombardier   0.1.173

MIT License GitHub

Fetches weather observations from the Australian Bureau of Metorology

Scala versions: 2.11 2.10

bombardier

Fetches weather observations from the Australian Bureau of Metorology.

Installation

Bring in the library by adding the following to your build.sbt.

  • The release repository:
   resolvers ++= Seq(
     "Millhouse Bintray"  at "http://dl.bintray.com/themillhousegroup/maven"
   )
  • The dependency itself:
   libraryDependencies ++= Seq(
     "com.themillhousegroup" %% "bombardier" % "0.1.170"
   )

Usage

Once you have bombardier added to your project, you can start using it like this:

import com.themillhousegroup.bombardier._
import scala.concurrent.ExecutionContext.Implicits.global

// Get the latest observation - this is an async op:
val fMaybeObs:Future[Option[Observation]] = Bombardier.observationForLatLong(-37.23D, 145.67D) 

// Do something with it:

fMaybeObs.foreach { maybeObservation =>
	maybeObservation.fold(println("No observation found")) { ob =>
		println("Most recent observation was $ob")
	}
}

Still To-Do

Document how to plug in an alternative HTTP client.

Credits