Created
November 10, 2009 01:07
-
-
Save mpen/230512 to your computer and use it in GitHub Desktop.
Twitter4jで検索
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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