Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
twitter4j-streamを使ってみる
@Grab('org.twitter4j:twitter4j-core:2.2.3')
@Grab('org.twitter4j:twitter4j-stream:2.2.3')
import twitter4j.*
import twitter4j.conf.*
def twitter = new TwitterFactory().instance
def stream = new TwitterStreamFactory().getInstance(twitter.getOAuthAccessToken())
stream.addListener(new UserStreamAdapter() {
void onStatus(Status status) {
println "<@${status.user.screenName}> ${status.text}"
}
})
stream.user()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.