Skip to content

Instantly share code, notes, and snippets.

@lorentzca
Created January 21, 2016 10:46
Show Gist options
  • Select an option

  • Save lorentzca/f99aa353554a84b81554 to your computer and use it in GitHub Desktop.

Select an option

Save lorentzca/f99aa353554a84b81554 to your computer and use it in GitHub Desktop.
集え我が一族
#!/usr/bin/ruby
require 'uri'
require 'open-uri'
require 'net/http'
open('http://data.iana.org/TLD/tlds-alpha-by-domain.txt') {|f|
f.each_line {|line|
next line if %r(^#) =~ line
url = "http://kunishima.#{line}"
begin
status = timeout(1) {
code = Net::HTTP.get_response(URI.parse(url)).code
puts url + ' : ' + code
}
rescue
end
}
}
@lorentzca

Copy link
Copy Markdown
Author
./kunishima.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment