class Whois::Parsers::WhoisEducauseEdu
Parser
for the whois.educause.edu server.
NOTE: This parser is just a stub and provides only a few basic methods to check for domain availability and get domain status. Please consider to contribute implementing missing methods. See WhoisNicIt
parser for an explanation of all available methods and examples.
Private Instance Methods
build_contact(element, type)
click to toggle source
- NAME
-
| EMPTY
[ROLE]?
- ORGANIZATION
-
[ADDRESS]*
- CITY, ST ZIP
- COUNTRY
- PHONE
- EMAIL
- COUNTRY
- CITY, ST ZIP
# File lib/whois/parsers/whois.educause.edu.rb, line 115 def build_contact(element, type) if content_for_scanner =~ /#{element}:\n+((.+\n)+)\n/ lines = $1.split("\n").map(&:strip) items = lines.dup # Extract variables # items.shift if items[0].strip == '' v13 = items.delete_at(-1) v11 = items.delete_at(-1) v9 = items.delete_at(-1) v6 = items.delete_at(-1) if v6 =~ /([^\n,]+),\s([A-Z]{2})(?:\s(\d{5}(?:-\d{4})?))/ v6, v7, v8 = $1, $2, $3 end v4 = [] until items[0] =~ /^\d+/ || items.empty? v4 << items.shift end v4 = v4.join("\n") v5 = items.empty? ? nil : items.join("\n") # Create Contact Parser::Contact.new( :type => type, :name => v4, :organization => nil, :address => v5, :city => v6, :state => v7, :zip => v8, :country => v9, :phone => v11, :email => v13 ) end end
build_contact_registrant(element, type)
click to toggle source
- ORGANIZATION
-
[ADDRESS]*
- CITY, ST ZIP
-
| [CITY]
- COUNTRY
# File lib/whois/parsers/whois.educause.edu.rb, line 164 def build_contact_registrant(element, type) if content_for_scanner =~ /#{element}:\n((.+\n)+)\n/ lines = $1.split("\n").map(&:strip) items = lines.dup # Extract variables v9 = items.delete_at(-1) v4 = items.delete_at(0) v6 = items.delete_at(-1) if v6 =~ /([^\n,]+),\s([A-Z]{2})(?:\s(\d{5}))/ v6, v7, v8 = $1, $2, $3 end v5 = items.empty? ? nil : items.join("\n") # Create Contact Parser::Contact.new( :type => type, :name => nil, :organization => v4, :address => v5, :city => v6, :state => v7, :zip => v8, :country => v9 ) end end