Created
June 11, 2011 05:18
-
-
Save irof/1020274 to your computer and use it in GitHub Desktop.
twitter4j-streamを使ってみる
This file contains hidden or 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
@Grab('org.twitter4j:twitter4j-core:2.2.3') | |
@Grab('org.twitter4j:twitter4j-stream:2.2.3') | |
import twitter4j.* | |
def twitter = new TwitterFactory().instance | |
def stream = new TwitterStreamFactory().getInstance(twitter.OAuthAccessToken) | |
def print = {println "@${it.user.screenName}: ${it.text}"} | |
stream.addListener([onStatus:print] as UserStreamAdapter) | |
stream.user() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment