class Whois::Record::Parser::WhoisDnsPl
Parser for the whois.dns.pl server.
@see Whois::Record::Parser::Example
The Example parser for the list of all available methods.
Public Instance Methods
response_throttled?()
click to toggle source
Checks whether the response has been throttled.
@return [Boolean]
@example
Looup quota exceeded.
# File lib/whois/record/parser/whois.dns.pl.rb, line 106 def response_throttled? !!(content_for_scanner =~ /^request limit exceeded for/) end
Private Instance Methods
build_contact(element, type)
click to toggle source
# File lib/whois/record/parser/whois.dns.pl.rb, line 113 def build_contact(element, type) match = content_for_scanner.slice(/#{element}:\n((.+\n)+)\n/, 1) return unless match values = parse_contact_block(match.split("\n")) zip, city = values["city"].match(/(.+?) (.+)/)[1..2] Record::Contact.new( :type => type, :id => values["handle"], :name => nil, :organization => values["company"], :address => values["street"], :city => city, :zip => zip, :state => nil, :country_code => values["location"], :phone => values["phone"], :fax => values["fax"], :email => nil ) end
parse_contact_block(lines)
click to toggle source
# File lib/whois/record/parser/whois.dns.pl.rb, line 136 def parse_contact_block(lines) key = nil hash = {} lines.each do |line| if line =~ /(.+):(.+)/ hash[key = $1] = $2.strip else hash[key] += "\n#{line.strip}" end end hash end