Thursday, February 19, 2009

Tweeting from the Scala interpreter

Verifying ricky_clarkson's post. Nice!

.oO(esmith@esmith-md jtwitter) wget
=> `jtwitter.jar'
Resolving done.
Connecting to[]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 197,281 [application/java-archive]

100%[==========>] 197,281 175.94K/s ETA 00:00

17:04:22 (175.94 KB/s) - `jtwitter.jar' saved [197281/197281]

.oO(esmith@esmith-md jtwitter) scala -classpath jtwitter.jar
Welcome to Scala version (Java HotSpot(TM)
Client VM, Java 1.5.0_16).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.collection.jcl.Conversions._
import scala.collection.jcl.Conversions._

scala> import winterwell.jtwitter.Twitter
import winterwell.jtwitter.Twitter

scala> val twitter = new Twitter("eishay", "*****")
twitter: winterwell.jtwitter.Twitter =

scala> twitter.getFriendsTimeline() take 10 map (s => s.getUser +
":" + s) foreach println
Slashdot:Security Researcher Kaminsky Pushes DNS Patching
Joe Nuxoll:Hey - everyone going to the Java Posse Roundup 2009,
please follow the twitter account @JPR09
WebGuild:Why Sun's New Cloud CTO Targeting Migration of Legacy
Apps First: By Chris Preimesberger Sun's new cloud computi..
WebGuild:Mobile Ads Stick: According to a study released today
by eMarketer, and reported on, mobile ads ..
WebGuild:Webstock 09 : Russ Weakley: Works at the Australian
Museum. Had an idea for the museum web site 4 years ago and
WebGuild:Cloud Computing Is a Tool, Not a Strategy: This week
IÕm listening in on HP talk to some of its customers about
popurls:Leaked Photo of the Next-Generation Mac Mini?
ZDNet Blogs:The message from GSMA Barcelona: fragmentation -
linkedin_news:"Facebook retains terms of service after users
voice concerns" by usa today [Facebook 100% ]
Technology Geek:Lifehacker - Best Live CDs? [Hive Five Call For Contenders]

scala> twitter.setStatus("Tweeting from the Scala interpreter")
res7: winterwell.jtwitter.Twitter.Status = Tweeting from the Scala interpreter


Creative Commons License This work by Eishay Smith is licensed under a Creative Commons Attribution 3.0 Unported License.