So I know I’m looping through a metric ton of information here, but this
has been running for 30 hours now. Anyone notice anything that might be
wrong?
require ‘rubygems’
require ‘whois’
doms = Array.new
avail = Array.new
456976.times do |i|
i = rand(36**4).to_s(36)
doms.push("#{i}.com")
end
doms = doms.uniq
puts “** Preparing to check #{doms.length.to_s} domains **”
doms.each { |i|
begin
if r = Whois.whois("#{i}").available?
puts “+ #{i}”
avail.push("#{i}")
end
rescue
puts “- Exception caught.”
end
}
puts “+ There are #{avail.length.to_s} domains available. Saving
output.”
avail.each { |i|
begin
File.open(‘domains.log’, ‘w’) { |file| file.write(i) }
rescue
end
}