Created
March 6, 2012 04:02
-
-
Save hexx/1983334 to your computer and use it in GitHub Desktop.
Get Tumblr Title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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