summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwjoe <joe@lc8n.com>2012-02-07 14:11:34 +0000
committerwjoe <joe@lc8n.com>2012-02-07 14:11:34 +0000
commit4f0b9c0bf1bb5ff4d36b2b280364be4a598be16e (patch)
tree0a96626c941ca7ad90122c84f3826885f1d6e30e
parent8aec40442a5543a6ef1f17db6bf8f50d9e381102 (diff)
Historic commit 2.1.1 - Fixed output bugs from previous versionHEADmaster
(07-Feb-2012 14:10)
-rw-r--r--blatweet.rb10
1 files 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