Commits

Richo Healey committed c677acf

Hacked up a loose wrapper around tweet printing

Your tweets will be blue :)

  • Participants
  • Parent commits 2869aa3

Comments (0)

Files changed (1)

File lib/twat/actions.rb

     def show
       twitter_auth
       Twitter.home_timeline.each_with_index do |tweet, idx|
-        puts "#{tweet.user.screen_name.bold.cyan}: #{tweet.text}"
+        format(tweet)
 
         break if idx == opts[:count]
       end
 
     private
 
+    # Format a tweet all pretty like
+    def format(twt)
+      # if config.color
+      if tweet.user.screen_name.to_sym == account_name.to_sym
+        puts "#{twt.user.screen_name.bold.blue}: #{twt.text}"
+      else
+        puts "#{twt.user.screen_name.bold.cyan}: #{twt.text}"
+      end
+    end
+
     def twitter_auth
       Twitter.configure do |twit|
         account.each do |key, value|