Created
March 28, 2010 18:28
-
-
Save kellyrob99/346942 to your computer and use it in GitHub Desktop.
Groovy script for grabbing last 20 Tweets in your home timeline.
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
@Grab(group='net.homeip.yusuke', module='twitter4j', version='2.0.10') | |
import twitter4j.Twitter | |
def getHomeTimeline() { | |
Console cons = System.console() | |
def getUsername = { cons.readLine( 'Enter a username: ' ).trim() } | |
def getPassword = { cons.readPassword( "Enter a password: ").toString()} | |
def twitter = new Twitter(getUsername(),getPassword()) | |
def response = twitter.getHomeTimeline() | |
response.each {status ->println "${status.text} FROM ${status.user.name} and SOURCE ${status.source}"; println ""} | |
} | |
getHomeTimeline() | |
println "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment