Skip to content

Instantly share code, notes, and snippets.

@gonzoooooo
Last active March 14, 2019 04:12
Show Gist options
  • Save gonzoooooo/c6cd10fb715d898bb4bc26b2d1d64614 to your computer and use it in GitHub Desktop.
Save gonzoooooo/c6cd10fb715d898bb4bc26b2d1d64614 to your computer and use it in GitHub Desktop.
.com と .jp のドメインの空きがあるか検索する
#!/usr/bin/env ruby
require "open3"
%w[.com .jp].map { |d| "#{ARGV[0]}#{d}" }.each do |domain|
out, = Open3.capture3("whois #{domain}")
puts "#{domain} is #{out.downcase.include?("no match")}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment