Created
March 3, 2011 02:24
-
-
Save include/852205 to your computer and use it in GitHub Desktop.
build funny OR stupid domain names
This file contains hidden or 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
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