Skip to content

Instantly share code, notes, and snippets.

@include
Created March 3, 2011 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save include/852205 to your computer and use it in GitHub Desktop.
Save include/852205 to your computer and use it in GitHub Desktop.
build funny OR stupid domain names
require 'open-uri'
letters = { 'v' => 'aeiou',
'c' => 'bcdfghjklmnpqrstvwxz' }
10.times do
@word = Array.new
"cvvcvc".each_char do |byte|
source = letters[byte]
@word << source[rand(source.length)].chr
end
tmp = @word << ".com"
domlookup = tmp.join
freemsg = "Domain name is not currently registered. Available for you now"
open("http://www.whois.net/getNB.cfm?domain_name=#{domlookup}") { |f|
@ref = f.read
@txt = @ref.index("#{freemsg}")
if @txt.nil?
puts "#{domlookup} - Sorry, domain is taken :("
else
puts "#{domlookup} - Cool, domain is available :)"
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment