Skip to content

Instantly share code, notes, and snippets.

@soramugi
Created June 12, 2012 18:27
Show Gist options
  • Save soramugi/2919224 to your computer and use it in GitHub Desktop.
Save soramugi/2919224 to your computer and use it in GitHub Desktop.
コマンドラインでツイート
require 'pit'
require 'twitter'
pit = Pit.get("twitter", :require => {
"consumer_key" => "your consumer_key in twitter",
"consumer_secret" => "your consumer_secret in twitter",
"token" => "your token in twitter",
"secret" => "your secret in twitter"
})
@tweet = ARGV[0] or abort "usage: $0 <tweet_nothing>"
Twitter.configure do |config|
config.consumer_key = pit['consumer_key']
config.consumer_secret = pit['consumer_secret']
config.oauth_token = pit['token']
config.oauth_token_secret = pit['secret']
end
Twitter.update(@tweet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment