-
-
Save bodiam/3f6eaf9ec262b3a4aa66 to your computer and use it in GitHub Desktop.
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(group = "org.twitter4j", module = "twitter4j-core", version = "4.0.2") | |
import twitter4j.* | |
Twitter twitter = new TwitterFactory().instance | |
def user = twitter.verifyCredentials() | |
println "Nb followers de ${user.name} (alias ${user.screenName}) : ${user.followersCount}" | |
long cursor = -1 | |
def followers = twitter.getFollowersList(user.screenName, cursor, 200) | |
followers.each {println "${it.screenName} - ${it.name}"} | |
while (followers.hasNext()) { | |
followers = twitter.getFollowersList(user.screenName, followers.getNextCursor(), 200) | |
followers.each {println "${it.screenName} - ${it.name}"} | |
} |
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
# Credentials from twitter console | |
twitter4j.oauth.consumerKey=<YourConsumerKey> | |
twitter4j.oauth.consumerSecret=<YourConsumerSecret> | |
twitter4j.oauth.accessToken=<YourAccessToken> | |
twitter4j.oauth.accessTokenSecret=<YourAccessTokenSecret> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment