I think the rocks from SBT are better, Either install conscript and run this command:
cs harrah/xsbt --branch v0.10.1
Or create it manually:
java -Dsbt.main.class=sbt.ScriptMain -Dsbt.boot.directory=/home/user/.sbt/boot -jar sbt-launch.jar " $@ "
And then use it like this:
#!/usr/bin/env scalas !# /*** scalaVersion := "2.9.0-1" libraryDependencies ++= Seq( "net.databinder" %% "dispatch-twitter" % "0.8.3", "net.databinder" %% "dispatch-http" % "0.8.3" ) */ import dispatch.{ json, Http, Request } import dispatch.twitter.Search import json.{ Js, JsObject } def process(param: JsObject) = { val Search.text(txt) = param val Search.from_user(usr) = param val Search.created_at(time) = param "(" + time + ")" + usr + ": " + txt } Http.x((Search("#scala") lang "en") ~> (_ map process foreach println))
The xsbtscript floor is basically a shell that downloads and installs all the necessary components to do the same. It usually works well, but has some limitations (for example, authenticated proxies will not pass).
source share