Created
April 18, 2011 15:04
-
-
Save nas/925520 to your computer and use it in GitHub Desktop.
A basic, console twitter status update script
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
#!/usr/local/bin/ruby | |
require 'rubygems' | |
require 'highline/import' | |
require 'twitter' | |
user = ask("Enter your twitter username:") {|q| q.echo = 'x'} | |
passwd = ask("Enter your twitter password:") {|q| q.echo = 'x'} | |
http_auth = Twitter::HTTPAuth.new user, passwd | |
client = Twitter::Base.new(http_auth) | |
puts 'connected to twitter' | |
exit = 'n' | |
while exit == 'n' || exit == 'no' | |
puts "Update status:" | |
message = gets.chomp | |
client.update message | |
puts "Twitter status updated successfully" | |
puts 'Do you want to exit? [Yn]' | |
exit = gets.chomp.downcase | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment