Skip to content

Instantly share code, notes, and snippets.

@yuroyoro
Created November 22, 2009 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuroyoro/240614 to your computer and use it in GitHub Desktop.
Save yuroyoro/240614 to your computer and use it in GitHub Desktop.
import scala.xml._
import scala.io.Source
object HashTagSearch{
def main( args:Array[String] ){
val url =
"http://search.twitter.com/search.atom?q=%s".format( args.first )
( XML.loadString(
Source.fromURL( url, "utf-8").getLines.mkString) \\ "entry").
foreach{
e =>
val cxml = XML.loadString("<c>" + (e \\ "content" text ) + "</c>")
println( (e \\ "author" \\ "name" text) + ":" + cxml.child.text)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment