Skip to content

Instantly share code, notes, and snippets.

@mpen
Created November 10, 2009 01:07
Show Gist options
  • Save mpen/230512 to your computer and use it in GitHub Desktop.
Save mpen/230512 to your computer and use it in GitHub Desktop.
Twitter4jで検索
// Twitter4jで検索
import scala.collection.jcl.Conversions.convertList
import twitter4j.{Tweet, QueryResult, Query, Twitter}
object Twitter4jSearch {
def main(args: Array[String]) {
val queryString = "#scala"
val lang = "ja"
val rpp = 5
val twitter = new Twitter
val query = new Query {
setQuery(queryString)
setLang(lang)
setRpp(rpp)
}
val result: QueryResult = twitter.search(query)
for (tweet: Tweet <- result.getTweets) {
printf("%s | %s%n", tweet.getFromUser, tweet.getText)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment