Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

the script I used to generate the godaddy list

  • Loading branch information...
commit 8e60c87338c45783c31bf7fbe7c7a1d22a119891 1 parent be5493b
@jpf authored
Showing with 64 additions and 0 deletions.
  1. +64 −0 profile-godaddy
View
64 profile-godaddy
@@ -0,0 +1,64 @@
+#!/usr/bin/env ruby
+# encoding: UTF-8
+$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/lib')
+
+require 'pp'
+require 'domain-profiler'
+require 'rubygems'
+require 'gchart'
+require 'erb'
+
+def fullname(name)
+ Name.new.full(name)
+end
+
+class Array
+ def lookup(host)
+ self.map{|name| Name.new.simplify(name,host) }.uniq
+ end
+end
+
+
+filename = ARGV[0]
+file = File.new(filename)
+
+hosts = {}
+list_name = ARGV[1] ? ARGV[1] : 'REPLACE ME'
+
+max_domain_length = 0
+
+file.map {|host|
+ if match_data = host.match(/^#List:(.*)/)
+ list_name = match_data[1]
+ end
+ next if host.match(/^#/)
+ host.chomp!
+ profile = DomainProfiler.new(host)
+
+ if(host.length > max_domain_length)
+ max_domain_length = host.length
+ end
+
+ registrar = profile.whois.registrar.lookup(host)
+ dns_host = profile.dns.ns.map{|record| Name.new.shorten(record.answer) }.lookup(host)
+ ssl_issuer = profile.ssl.ca.lookup(host)
+
+ out = {}
+ out[:registrar] = (registrar[0] == :godaddy) ? 4 : 0
+ out[:dns_host] = (dns_host[0] == :godaddy) ? 2 : 0
+ out[:ssl_issuer] = (ssl_issuer[0] == :godaddy) ? 1 : 0
+ out[:sort_key] = out[:registrar] + out[:dns_host] + out[:ssl_issuer]
+ hosts[host] = out
+}
+
+# Turn the list of host data into a hash of type data
+hosts.sort_by{ |hostname,data| data[:sort_key].to_s + hostname }.each do |hostname,data|
+ next unless data[:sort_key] > 0
+ puts "%s %s %s %s" % [hostname.ljust(max_domain_length,' '),
+ (data[:registrar] > 0) ? 'REGISTRAR' : ' ',
+ (data[:dns_host] > 0) ? 'DNS' : ' ',
+ (data[:ssl_issuer] > 0) ? 'SSL' : ' '
+ ]
+
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.