bin/twhois in twhois-0.0.1 vs bin/twhois in twhois-0.0.2

- old
+ new

@@ -1,26 +1,31 @@ #! /usr/bin/env ruby require 'rubygems' require 'twhois' -ARGV.each do |username| - user = Twhois.lookup(username) - if user - puts "@#{user.screen_name}:" - puts " Name: #{user.name}" - puts " URL: #{user.url}" if user.url - puts " Location: #{user.location}" if user.location - puts " Description: #{user.description}" if user.description - puts " Followers: #{user.followers_count}" - puts " Following: #{user.friends_count}" - puts " Tweets: #{user.statuses_count}" - puts " Last Tweet (#{user.status['created_at']}):" - puts " #{user.status['text']}" - puts " Timezone: #{user.time_zone}" if user.time_zone - puts " Joined On: #{user.created_at}" - puts " Profile Picture: #{user.profile_image_url}" - puts " Private Account: #{user.protected ? "Yes" : "No"}" - else - puts "@#{username}:" - puts " Not Found" +if ARGV.size > 0 + ARGV.each do |username| + user = Twhois.lookup(username) + if user + puts "@#{user.screen_name}:" + puts " Name: #{user.name}" + puts " URL: #{user.url}" if user.url + puts " Location: #{user.location}" if user.location + puts " Description: #{user.description}" if user.description + puts " Followers: #{user.followers_count}" + puts " Following: #{user.friends_count}" + puts " Tweets: #{user.statuses_count}" + puts " Last Tweet (#{user.status['created_at']}):" + puts " #{user.status['text']}" + puts " Timezone: #{user.time_zone}" if user.time_zone + puts " Joined On: #{user.created_at}" + puts " Profile Picture: #{user.profile_image_url}" + puts " Private Account: #{user.protected ? "Yes" : "No"}" + else + puts "@#{username}:" + puts " Not Found" + end end +else + puts "Usage: twhois username [another_user] [yet_another]" end +