Skip to content

Instantly share code, notes, and snippets.

@patrickdevivo
Created January 4, 2012 22:41
Show Gist options
  • Save patrickdevivo/1562604 to your computer and use it in GitHub Desktop.
Save patrickdevivo/1562604 to your computer and use it in GitHub Desktop.
Update twitter status
require 'twitter'
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''
config.oauth_token_secret = ''
end
if ARGV[0] == '-t' and ARGV[1] # if -t flag and tweet exist
tweet = ARGV[1]
elsif ARGV[0] == '-t' and ARGV[1] = "" # if -t flag and no tweet
puts "Enter a tweet with -t \"this is my tweet\""
else
puts "Enter a tweet:"
tweet = gets
end
Twitter.update(tweet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment