Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (18 sloc) 0.566 kB
#!/usr/bin/env ruby -wKU
$:.unshift(File.expand_path("../../lib", __FILE__))
require "fileutils"
require "whois"
require File.expand_path("../whois-utf8", __FILE__) rescue nil
d = ARGV.shift || raise("Missing domain")
n = ARGV.shift || raise("Missing file name")
r = Whois.query(d)
if r.parts.size == 1
r.parts.each do |part|
p = File.expand_path("../../spec/fixtures/responses/#{part.host}/#{n}", __FILE__)
FileUtils.mkdir_p(File.dirname(p))
File.open(p, "w+") { |f| f.write(part.body) }
puts "Saved #{p}"
end
else
raise("Multipart")
end
Jump to Line
Something went wrong with that request. Please try again.