Skip to content

Instantly share code, notes, and snippets.

@troyk
Created May 4, 2011 15:37
Show Gist options
  • Save troyk/955431 to your computer and use it in GitHub Desktop.
Save troyk/955431 to your computer and use it in GitHub Desktop.
Ruby script to find available domain names
#!/usr/bin/env ruby
require "whois"
require "hirb"
$results = []
$alphebet = (97..122).map {|x| x.chr}
$base = "fit"
$alphebet.each do |letter|
["#{letter}#{$base}.com","#{$base}#{letter}.com"].each do |domain|
t = Thread.new(domain) do |domain|
who = Whois.whois(domain)
puts "#{domain} (#{who.available?})"
$results << who
end
t.join
end
end
puts Hirb::Helpers::AutoTable.render($results,:fields=>[:domain,:registered?,:available?,:created_on,:expires_on])
=begin
can you believe this???
afit.com (false)
fita.com (false)
bfit.com (false)
fitb.com (false)
cfit.com (false)
fitc.com (false)
dfit.com (false)
fitd.com (false)
efit.com (false)
fite.com (false)
ffit.com (false)
fitf.com (false)
gfit.com (false)
fitg.com (false)
hfit.com (false)
fith.com (false)
ifit.com (false)
fiti.com (false)
jfit.com (false)
fitj.com (false)
kfit.com (false)
fitk.com (false)
lfit.com (false)
fitl.com (false)
mfit.com (false)
fitm.com (false)
nfit.com (false)
fitn.com (false)
ofit.com (false)
fito.com (false)
pfit.com (false)
fitp.com (false)
qfit.com (false)
fitq.com (false)
rfit.com (false)
fitr.com (false)
sfit.com (false)
fits.com (false)
tfit.com (false)
fitt.com (false)
ufit.com (false)
fitu.com (false)
vfit.com (false)
fitv.com (false)
wfit.com (false)
fitw.com (false)
xfit.com (false)
fitx.com (false)
yfit.com (false)
fity.com (false)
zfit.com (false)
fitz.com (false)
+----------+-------------+------------+---------------------------+---------------------------+
| domain | registered? | available? | created_on | expires_on |
+----------+-------------+------------+---------------------------+---------------------------+
| afit.com | true | false | 2002-04-08 00:00:00 -0700 | 2012-04-08 00:00:00 -0700 |
| fita.com | true | false | 2000-09-26 00:00:00 -0700 | 2011-09-26 00:00:00 -0700 |
| bfit.com | true | false | 1995-08-11 00:00:00 -0700 | 2015-08-10 00:00:00 -0700 |
| fitb.com | true | false | 2000-03-12 00:00:00 -0800 | 2013-03-12 00:00:00 -0700 |
| cfit.com | true | false | 1996-08-14 00:00:00 -0700 | 2011-08-13 00:00:00 -0700 |
| fitc.com | true | false | 1996-03-20 00:00:00 -0800 | 2012-03-21 00:00:00 -0700 |
| dfit.com | true | false | 1999-12-11 00:00:00 -0800 | 2013-12-11 00:00:00 -0800 |
| fitd.com | true | false | 2005-03-08 00:00:00 -0800 | 2012-03-08 00:00:00 -0800 |
| efit.com | true | false | 1998-04-01 00:00:00 -0800 | 2016-03-31 00:00:00 -0700 |
| fite.com | true | false | 1996-06-06 00:00:00 -0700 | 2011-06-05 00:00:00 -0700 |
| ffit.com | true | false | 1999-12-01 00:00:00 -0800 | 2013-12-01 00:00:00 -0800 |
| fitf.com | true | false | 2001-11-16 00:00:00 -0800 | 2011-11-16 00:00:00 -0800 |
| gfit.com | true | false | 1998-03-11 00:00:00 -0800 | 2013-03-10 00:00:00 -0800 |
| fitg.com | true | false | 2003-09-29 00:00:00 -0700 | 2011-09-29 00:00:00 -0700 |
| hfit.com | true | false | 1997-12-23 00:00:00 -0800 | 2013-12-22 00:00:00 -0800 |
| fith.com | true | false | 1998-09-17 00:00:00 -0700 | 2011-09-16 00:00:00 -0700 |
| ifit.com | true | false | 1997-03-10 00:00:00 -0800 | 2015-12-03 00:00:00 -0800 |
| fiti.com | true | false | 1998-06-19 00:00:00 -0700 | 2012-06-18 00:00:00 -0700 |
| jfit.com | true | false | 1999-05-26 00:00:00 -0700 | 2014-05-26 00:00:00 -0700 |
| fitj.com | true | false | 2006-05-03 00:00:00 -0700 | 2012-05-03 00:00:00 -0700 |
| kfit.com | true | false | 2001-06-29 00:00:00 -0700 | 2011-06-29 00:00:00 -0700 |
| fitk.com | true | false | 2009-10-25 00:00:00 -0700 | 2012-10-25 00:00:00 -0700 |
| lfit.com | true | false | 1999-12-13 00:00:00 -0800 | 2013-12-13 00:00:00 -0800 |
| fitl.com | true | false | 2001-06-29 00:00:00 -0700 | 2012-04-24 00:00:00 -0700 |
| mfit.com | true | false | 2003-09-14 00:00:00 -0700 | 2014-09-14 00:00:00 -0700 |
| fitm.com | true | false | 2004-06-30 00:00:00 -0700 | 2014-06-30 00:00:00 -0700 |
| nfit.com | true | false | 1999-12-15 00:00:00 -0800 | 2013-12-15 00:00:00 -0800 |
| fitn.com | true | false | 2004-07-26 00:00:00 -0700 | 2011-07-26 00:00:00 -0700 |
| ofit.com | true | false | 1999-12-18 00:00:00 -0800 | 2013-12-18 00:00:00 -0800 |
| fito.com | true | false | 2001-07-03 00:00:00 -0700 | 2011-07-03 00:00:00 -0700 |
| pfit.com | true | false | 1997-08-11 00:00:00 -0700 | 2011-08-10 00:00:00 -0700 |
| fitp.com | true | false | 2002-05-13 00:00:00 -0700 | 2011-05-13 00:00:00 -0700 |
| qfit.com | true | false | 1996-02-10 00:00:00 -0800 | 2015-02-11 00:00:00 -0800 |
| fitq.com | true | false | 2003-12-27 00:00:00 -0800 | 2011-12-27 00:00:00 -0800 |
| rfit.com | true | false | 2001-07-02 00:00:00 -0700 | 2011-07-02 00:00:00 -0700 |
| fitr.com | true | false | 2002-03-25 00:00:00 -0800 | 2012-03-25 00:00:00 -0700 |
| sfit.com | true | false | 1999-11-30 00:00:00 -0800 | 2013-11-30 00:00:00 -0800 |
| fits.com | true | false | 1999-01-07 00:00:00 -0800 | 2012-01-07 00:00:00 -0800 |
| tfit.com | true | false | 1999-12-13 00:00:00 -0800 | 2013-12-13 00:00:00 -0800 |
| fitt.com | true | false | 1996-05-28 00:00:00 -0700 | 2011-05-27 00:00:00 -0700 |
| ufit.com | true | false | 1997-09-26 00:00:00 -0700 | 2012-09-25 00:00:00 -0700 |
| fitu.com | true | false | 2002-06-22 00:00:00 -0700 | 2011-06-22 00:00:00 -0700 |
| vfit.com | true | false | 2001-04-05 00:00:00 -0700 | 2012-04-05 00:00:00 -0700 |
| fitv.com | true | false | 2000-05-29 00:00:00 -0700 | 2012-05-29 00:00:00 -0700 |
| wfit.com | true | false | 1999-12-17 00:00:00 -0800 | 2013-12-17 00:00:00 -0800 |
| fitw.com | true | false | 2004-10-09 00:00:00 -0700 | 2011-10-09 00:00:00 -0700 |
| xfit.com | true | false | 2002-05-08 00:00:00 -0700 | 2011-05-08 00:00:00 -0700 |
| fitx.com | true | false | 1996-04-26 00:00:00 -0700 | 2012-04-27 00:00:00 -0700 |
| yfit.com | true | false | 2003-11-27 00:00:00 -0800 | 2011-11-27 00:00:00 -0800 |
| fity.com | true | false | 2001-11-27 00:00:00 -0800 | 2011-11-27 00:00:00 -0800 |
| zfit.com | true | false | 2002-01-13 00:00:00 -0800 | 2013-01-13 00:00:00 -0800 |
| fitz.com | true | false | 1995-12-26 00:00:00 -0800 | 2017-12-25 00:00:00 -0800 |
+----------+-------------+------------+---------------------------+---------------------------+
52 rows in set
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment