Created
February 27, 2016 00:42
-
-
Save mindplace/6fba36c25a1c2ce3d1b8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| if __FILE__ == $PROGRAM_NAME | |
| blogger = MicroBlogger.new | |
| puts "\nWelcome to the JSL Twitter client!" | |
| puts "Available commands:" | |
| puts " q => quit" | |
| puts " dm => direct message " | |
| puts " t => tweet" | |
| puts " g => see all the latest tweets from friends\n\n" | |
| command = "" | |
| commands = {"dm" => "route_dm", "t"=>"tweet", "q"=>"quit", | |
| "g" => "get_all_latest_friends_tweets"} | |
| while command != "quit" | |
| print "Enter command: " | |
| command = commands[gets.chomp] | |
| if blogger.respond_to?(command) | |
| blogger.send(command) | |
| puts | |
| elsif command == "quit" | |
| break | |
| else puts "Sorry, that command is not set!" | |
| end | |
| end | |
| puts "\nThanks for using the JSL Twitter client!\n\n" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment