From 4f0b9c0bf1bb5ff4d36b2b280364be4a598be16e Mon Sep 17 00:00:00 2001 From: wjoe Date: Tue, 7 Feb 2012 14:11:34 +0000 Subject: Historic commit 2.1.1 - Fixed output bugs from previous version (07-Feb-2012 14:10) --- blatweet.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blatweet.rb b/blatweet.rb index 4cba2a7..42b0e13 100644 --- a/blatweet.rb +++ b/blatweet.rb @@ -11,7 +11,7 @@ number_of_tweets = 1 message = nil limit = false debug = false -version = 'v2.1.0' +version = 'v2.1.1' help = false options = false irc_nick = nil @@ -41,7 +41,7 @@ if args == [] exit(-1) end -def post_message account, message +def post_message account, message, config puts "Your message is #{message.length} characters." if message.length > 140 response = oauth_client(account, config).update message puts response['error'] ? response['error'] : "Posted tweet." @@ -100,7 +100,7 @@ begin config = YAML::load( File.open( 'config.yaml' ) ) client = TwitterOAuth::Client.new - if options + if options == true ops.to_s.split(/\n\s*|\s{2,}/).each{|opt| output << opt} puts output.join(' ') elsif help @@ -111,12 +111,12 @@ begin reset_time = DateTime.parse rate_limit_status['reset_time'] puts remaining_hits == 0 ? "Limit reached. Limit resets in #{(60 + reset_time.min) - Time.now.min} minutes." : "Remaining hits this hour: #{remaining_hits}. #{remaining_hits/((60 + reset_time.min) - Time.now.min)} hits/minute." elsif message - post_message irc_nick, message + post_message irc_nick, message, config elsif username client.search("from:#{username}", :rpp => number_of_tweets)['results'].each_with_index{|tweet, index| output << "#{index+1}: #{tweet['text']}"} puts output.join ' ' else - post_message 'intense_marcus', ARGV.join(' ') + post_message 'intensemarcus', ARGV.join(' '), config end rescue StandardError => e -- cgit v1.2.3