Created
December 13, 2012 10:47
-
-
Save jetpks/4275668 to your computer and use it in GitHub Desktop.
Find available three letter .io domains from list of any sized words in a file called ./wordlist.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'whois' | |
def load_words | |
three_letter_words = [] | |
File.open('./wordlist', 'r') do |infile| | |
while (line = infile.gets) | |
next if (line == nil or line.chomp.length > 3) | |
three_letter_words.push(line.chomp) | |
end | |
end | |
return three_letter_words | |
end | |
def query_and_report(domain, client=Whois::Client.new) | |
if client.query(domain).available? | |
puts "Available: #{domain}" | |
File.open('./three_available', 'a') do |out| | |
out.write("#{domain}\n") | |
end | |
end | |
end | |
def wait(rstart, rend) | |
sleep(rand(rstart..rend)) | |
end | |
c = Whois::Client.new | |
load_words.each do |word| | |
query_and_report("#{word}.io",c) | |
wait(1,3) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment