Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2013 13:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Retrieving rates from json object
import play.api.libs.json._
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.Await
import scala.concurrent.duration._
// Just for the example in the console - Await is WRONG
val result = WS.url("").get()
val json = Await.result(result, DurationInt(5).seconds).json
// This is the part to retrieve the keys
val rates = ( __ \ "rates").read[JsObject].reads(json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment