Sha256: caf208144277512ff7593eb037bc43b0a5873a05319bd697fdb85cdc24ea8495

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

#! /usr/bin/env ruby
require 'rubygems'
require 'twhois'

if ARGV.size > 0
  ARGV.each do |username|
    begin
      user = Twhois.lookup(username)
      if user
        puts "@#{user.screen_name}:"
        puts "  Name: #{user.name}"
        puts "  URL: #{user.url}" if user.respond_to?(:url)
        puts "  Profile: http://twitter.com/#{user.screen_name}"
        puts "  Location: #{user.location}" if user.respond_to?(:location)
        puts "  Description: #{user.description}" if user.respond_to?(:description)
        puts "  Followers: #{user.followers_count}"
        puts "  Following: #{user.friends_count}"
        puts "  Tweets: #{user.statuses_count}"
        if user.respond_to?(:status)
          puts "  Last Tweet (#{user.status['created_at']}):"
          puts "    #{user.status['text']}"
        end
        puts "  Timezone: #{user.time_zone}" if user.respond_to?(: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
    rescue Twhois::InvalidUsername => e
      puts "\"#{username}\" is not a valid Twitter username"
    end
  end
else
  puts "Usage: twhois username [another_user] [yet_another]"  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twhois-0.0.3 bin/twhois