Skip to content

Instantly share code, notes, and snippets.

@irof
Created June 11, 2011 05:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save irof/1020274 to your computer and use it in GitHub Desktop.
Save irof/1020274 to your computer and use it in GitHub Desktop.
twitter4j-streamを使ってみる
@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