Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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