Skip to content

Instantly share code, notes, and snippets.

@spangenberg
Created October 31, 2010 17:12
Show Gist options
  • Save spangenberg/656842 to your computer and use it in GitHub Desktop.
Save spangenberg/656842 to your computer and use it in GitHub Desktop.
require "whois"
class Array
def shuffle
sort_by { rand }
end
def shuffle!
self.replace shuffle
end
end
names = Array.new
50.times do |n|
v = %w(a e i o u)
k = %w(b c d f g h j k l m n p q r s t v w x y z)
output = ""
6.times do |i|
output += if i % 2 == 1
v.shuffle!
v.delete(v[0])
else
k.shuffle!
k.delete(k[0])
end
end
unless names.include?(output)
names.push(output)
a = Whois.whois("#{output}.com")
puts "#{output}.com" if a.available?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment