require "net/http" if ARGV.size == 0 puts "Usage: dictionary term" exit end a = Net::HTTP.get("www.dictionary.com","/cgi-bin/dict.pl?term=#{ARGV[0]}") if ( a=~/No entry found for/ ) puts "No entry found for '#{ARGV[0]}' - Suggestions:\n\n" while $' =~/(\w+)/ puts $1 end else while a =~ // $' =~ // a=$' puts $`.gsub(/<.*?>/m){ |i| case i when "" "" when "" "\n" when "

" "" else "" end } end end