Created
January 4, 2012 22:41
-
-
Save patrickdevivo/1562604 to your computer and use it in GitHub Desktop.
Update twitter status
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
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