I know there are quite a few ruby coders on here. Why is there only a PHP and Python thread?
Checks for available exact match domains.
.org domains return not found which is unreliable so only .com and .net are checked.
As I am new to ruby feel free to improve/correct my script
Checks for available exact match domains.
.org domains return not found which is unreliable so only .com and .net are checked.
As I am new to ruby feel free to improve/correct my script
Code:
class Emds
def available(keyword)
kws = Array.new
res = Array.new
kws << keyword.gsub(/ /, '')
kws << keyword.gsub(/ /, '-')
tlds = ['.com','.net']
kws.each do |kw|
tlds.each do |tld|
domain = kw + tld
whois = `whois #{domain}`
res << domain if whois.include?( "No match" )
end
end
return res
end
end
# how to use
emds = Emds.new
puts emds.available("insert keyword here")