ScalaからOAuthを使うにはDispatch
今、Liftのチュートリアルのチャットアプリを改造中。Twitterと連携させたいと思ってるので、OAuthの機能を組み込もうと思う。OAuth自体が良く分かってないんだけど。
どうやらDispatchなるものを使うらしい。正式名称はDatabinder Dispatch?Webサイトはこちら。
sbtでの設定は、LiftProject.scalaのlibraryDependenciesに以下の記述を追加。
"net.databinder" %% "dispatch" % "0.7.7"
その後にsbtでreloadとupdateをやればOKなのかな。
以下、自分にログを残しておく。
> reload reload [info] Recompiling project definition... [info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed. [info] Building project Lift SBT Template 0.1 against Scala 2.8.0 [info] using LiftProject with sbt 0.7.4 and Scala 2.7.7 > update update [info] [info] == update == [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-oauth_2.8.0/0.7.7/dispatch-oauth_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-oauth_2.8.0;0.7.7!dispatch-oauth_2.8.0.jar (221ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-meetup_2.8.0/0.7.7/dispatch-meetup_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-meetup_2.8.0;0.7.7!dispatch-meetup_2.8.0.jar (337ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-http_2.8.0/0.7.7/dispatch-http_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-http_2.8.0;0.7.7!dispatch-http_2.8.0.jar (140ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-twitter_2.8.0/0.7.7/dispatch-twitter_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-twitter_2.8.0;0.7.7!dispatch-twitter_2.8.0.jar (82ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-couch_2.8.0/0.7.7/dispatch-couch_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-couch_2.8.0;0.7.7!dispatch-couch_2.8.0.jar (81ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-times_2.8.0/0.7.7/dispatch-times_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-times_2.8.0;0.7.7!dispatch-times_2.8.0.jar (68ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-s3_2.8.0/0.7.7/dispatch-s3_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-s3_2.8.0;0.7.7!dispatch-s3_2.8.0.jar (71ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-http-json_2.8.0/0.7.7/dispatch-http-json_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-http-json_2.8.0;0.7.7!dispatch-http-json_2.8.0.jar (66ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-mime_2.8.0/0.7.7/dispatch-mime_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-mime_2.8.0;0.7.7!dispatch-mime_2.8.0.jar (69ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-google_2.8.0/0.7.7/dispatch-google_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-google_2.8.0;0.7.7!dispatch-google_2.8.0.jar (68ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-json_2.8.0/0.7.7/dispatch-json_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-json_2.8.0;0.7.7!dispatch-json_2.8.0.jar (139ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-futures_2.8.0/0.7.7/dispatch-futures_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-futures_2.8.0;0.7.7!dispatch-futures_2.8.0.jar (71ms) [info] downloading http://scala-tools.org/repo-releases/net/databinder/dispatch-lift-json_2.8.0/0.7.7/dispatch-lift-json_2.8.0-0.7.7.jar ... [info] [SUCCESSFUL ] net.databinder#dispatch-lift-json_2.8.0;0.7.7!dispatch-lift-json_2.8.0.jar (68ms) [info] downloading http://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar ... [info] [SUCCESSFUL ] org.apache.httpcomponents#httpclient;4.0.1!httpclient.jar (590ms) [info] downloading http://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar ... [info] [SUCCESSFUL ] org.apache.httpcomponents#httpcore;4.0.1!httpcore.jar (191ms) [info] downloading http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar ... [info] [SUCCESSFUL ] commons-logging#commons-logging;1.1.1!commons-logging.jar (361ms) [info] downloading http://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.0.1/httpmime-4.0.1.jar ... [info] [SUCCESSFUL ] org.apache.httpcomponents#httpmime;4.0.1!httpmime.jar (355ms) [info] downloading http://repo1.maven.org/maven2/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6.jar ... [info] [SUCCESSFUL ] org.apache.james#apache-mime4j;0.6!apache-mime4j.jar (573ms) [info] :: retrieving :: Lift#lift-sbt-template_2.8.0 [sync] [info] confs: [compile, runtime, test, provided, system, optional, sources, javadoc] [info] 18 artifacts copied, 22 already retrieved (1499kB/76ms) [info] == update == [success] Successful. [info] [info] Total time: 56 s, completed Oct 15, 2010 7:31:43 PM
実際に使うのはこれから。