Skip to content

Instantly share code, notes, and snippets.

@seratch
Created December 8, 2012 05:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save seratch/4238807 to your computer and use it in GitHub Desktop.
Save seratch/4238807 to your computer and use it in GitHub Desktop.
Tweet from Gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.twitter4j', name: 'twitter4j-core', version: '3.0.2'
}
}
import twitter4j.*
import java.io.*
task say << {
Twitter twitter = new TwitterFactory().getInstance()
Status status = twitter.updateStatus(project.tweet)
println("Successfully updated the status to [" + status.getText() + "].")
}
// Usage: gradle say -Ptweet="Hello Gradle! #m3dev"
debug=true
oauth.consumerKey=***
oauth.consumerSecret=***
oauth.accessToken=***
oauth.accessTokenSecret=***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment