Skip to content

Instantly share code, notes, and snippets.

@hexx
Created March 6, 2012 04:02
Show Gist options
  • Save hexx/1983334 to your computer and use it in GitHub Desktop.
Save hexx/1983334 to your computer and use it in GitHub Desktop.
Get Tumblr Title
#!/usr/bin/env scalas
!#
/***
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch-http" % "0.8.8",
"net.databinder" %% "dispatch-http-json" % "0.8.8"
)
*/
import dispatch._
import dispatch.json.JsHttp._
val http = new Http
val key = "zMy8BEqJ6lPfumkFurUKcz6BdrQtrUkzx1vwnFobeudkQTWv8F"
val query = Map("api_key" -> key)
val req = :/("api.tumblr.com") / "v2" / "blog" / "pab-tech.tumblr.com" / "info" <<? query
val handler = req ># ('response ! ('blog ? ('title ? str)))
val title = http(handler)
println(title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment