Created
September 7, 2019 10:00
-
-
Save pooza/49eb89e2b4edbdab7bf6de1e456fc3e6 to your computer and use it in GitHub Desktop.
This file contains 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 'resolv' | |
require 'httparty' | |
require 'timeout' | |
File.read('./instances.txt').each_line(chomp: true) do |domain| | |
Timeout.timeout(10) do | |
Resolv::DNS.new.getaddress(domain) | |
code = HTTParty.get("https://#{domain}/about").code | |
raise '404' if code == 404 | |
raise '410' if code == 410 | |
end | |
rescue => e | |
puts "#{domain} (#{e.message})" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment