Created
March 5, 2016 18:28
-
-
Save gnagel/6f357315b949cdadf2e0 to your computer and use it in GitHub Desktop.
Find me an available .io domain
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
#!/usr/bin/env ruby | |
require 'faraday' | |
io = ["adag", "ag", "ambros", "ambulat", "anton", "ap", "arpegg", "aud", "bagn", "bardigl", "barr", "bib", "bil", "bocacc", "borach", "bracc", "cab", "cadiue", "capricc", "caquet", "castal", "cellvibr", "cheer", "circumlit", "claud", "cl", "combolo", "conduct", "confederat", "conservator", "curcul", "cur", "daim", "dan", "desulfovibr", "disag", "dur", "dus", "equilibr", "escamb", "estad", "esthes", "exrad", "fasc", "fellat", "fer", "fiatconfirmat", "fidel", "finoch", "floripond", "fol", "g", "gob", "gugl", "hel", "histr", "horat", "idd", "imbrogl", "impresar", "intagl", "internunc", "", "jubilat", "jul", "kok", "kurosh", "latticin", "lucent", "mar", "med", "me", "migl", "misch", "mo", "mustach", "na", "nga", "noctil", "nunc", "oh", "ol", "orator", "ouaba", "overlubricat", "papil", "pap", "pat", "patric", "photointagl", "photorad", "pistach", "pol", "porphyr", "portfol", "port", "prerad", "presid", "punctil", "rad", "rascac", "rat", "rest", "r", "rorator", "rosar", "rosol", "scenar", "scorp", "senec", "septentr", "seragl", "serg", "ser", "sipp", "sit", "sod", "solfegg", "sol", "sta", "struth", "stud", "suta", "tenebr", "ten", "terc", "th", "thur", "tr", "tur", "turs", "un", "vespertil", "vibr"] | |
io.inject({}) do |h, i| | |
domain = "#{i}.io" | |
body = Faraday.new(url: "https://www.transip.eu").get("/whois/prm/#{domain}").body rescue "" | |
h[domain] = case | |
when body.length <= 0 | |
"Timeout" | |
else | |
!body.include?('Status : Live') | |
end | |
puts "#{domain} -> #{h[domain]}" | |
h | |
end | |
puts io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment