Skip to content

Commit

Permalink
Add whois.donuts.co parser
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Mar 10, 2014
1 parent 4cc3e61 commit 3b6688b
Show file tree
Hide file tree
Showing 9 changed files with 560 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

- SERVER: Updated list of latest ASN allocations of 16-bit & 32-bit ASN's from IANA (GH-293). [Thanks @itsbalamurali]

- SERVER: Added new gTLDs (GH-305)

- NEW: Added whois.donuts.co parser.

- CHANGED: Updated whois.nic.net.sa parser to the new response format.

- CHANGED: Updated whois.nic.cz parser to the new response format.
Expand Down
63 changes: 63 additions & 0 deletions lib/whois/record/parser/whois.donuts.co.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2014 Simone Carletti <[email protected]>
#++


require 'whois/record/parser/base_icann_compliant'


module Whois
class Record
class Parser

# Parser for the whois.donuts.com server.
#
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
class WhoisDonutsCo < BaseIcannCompliant
self.scanner = Scanners::BaseIcannCompliant, {
pattern_available: /^Domain not found\.\n/
}


property_supported :domain_id do
node('Domain ID')
end


property_supported :expires_on do
node('Registry Expiry Date') do |value|
Time.parse(value)
end
end


property_supported :registrar do
return unless node('Sponsoring Registrar')
Record::Registrar.new(
id: node('Sponsoring Registrar IANA ID'),
name: node('Sponsoring Registrar'),
organization: node('Sponsoring Registrar')
)
end


private

def build_contact(element, type)
if (contact = super)
contact.id = node("#{element} ID")
end
contact
end

end

end
end
end
2 changes: 1 addition & 1 deletion lib/whois/record/parser/whois.networksolutions.com.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class WhoisNetworksolutionsCom < BaseIcannCompliant

def build_contact(element, type)
if (contact = super) && !contact.state.present?
contact.state = value_for_property(element, 'State')
contact.state = node("#{element} State")
end
contact
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#domain
%s == nil

#domain_id
%s == nil


#status
%s == :available

#available?
%s == true

#registered?
%s == false


#created_on
%s == nil

#updated_on
%s == nil

#expires_on
%s == nil


#registrar
%s == nil


#registrant_contacts
%s %CLASS{array}
%s == []

#admin_contacts
%s %CLASS{array}
%s == []

#technical_contacts
%s %CLASS{array}
%s == []


#nameservers
%s %CLASS{array}
%s == []
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Domain not found.

Terms of Use: Users accessing the Donuts WHOIS service must agree to use the data only for lawful purposes, and under under no circumstances use the data to: Allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the registrar's own existing customers. Enable high volume, automated, electronic processes that send queries or data to the systems of Donuts or any ICANN-accredited registrar, except as reasonably necessary to register domain names or modify existing registrations. When using the Donuts Whois service, please consider the following: The Whois service is not a replacement for standard EPP commands to the SRS service. Whois is not considered authoritative for registered domain objects. The Whois service may be scheduled for downtime during production or OT&E maintenance periods. Queries to the Whois services are throttled. If too many queries are received from a single IP address within a specified time, the service will begin to reject further queries for a period of time to prevent disruption of Whois service access.
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#domain
%s == "whereismy.bike"

#domain_id
%s == "C52CECC9AF044831A7335E8A0ECBC349-D"


#status
%s == :registered

#available?
%s == false

#registered?
%s == true


#created_on
%s %CLASS{time}
%s %TIME{2014-02-21 22:55:07 UTC}

#updated_on
%s %CLASS{time}
%s %TIME{2014-02-21 22:55:08 UTC}

#expires_on
%s %CLASS{time}
%s %TIME{2015-02-21 22:55:07 UTC}


#registrar
%s %CLASS{registrar}
%s.id == "48"
%s.name == "Enom, Inc."
%s.organization == "Enom, Inc."
%s.url == nil


#registrant_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
%s[0].id == "8ff85c48fbd456f1"
%s[0].name == "whoisguard protected"
%s[0].organization == "WhoisGuard, Inc."
%s[0].address == "P.O. Box 0823-03411"
%s[0].city == "Panama"
%s[0].zip == "00000"
%s[0].state == "Panama"
%s[0].country == nil
%s[0].country_code == "PA"
%s[0].phone == "+507.8365503"
%s[0].fax == "+51.17057182"
%s[0].email == "[email protected]"
%s[0].created_on == nil
%s[0].updated_on == nil

#admin_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Record::Contact::TYPE_ADMINISTRATIVE
%s[0].id == "8ff85c48fbd456f1"
%s[0].name == "whoisguard protected"
%s[0].organization == "WhoisGuard, Inc."
%s[0].address == "P.O. Box 0823-03411"
%s[0].city == "Panama"
%s[0].zip == "00000"
%s[0].state == "Panama"
%s[0].country == nil
%s[0].country_code == "PA"
%s[0].phone == "+507.8365503"
%s[0].fax == "+51.17057182"
%s[0].email == "[email protected]"
%s[0].created_on == nil
%s[0].updated_on == nil

#technical_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Record::Contact::TYPE_TECHNICAL
%s[0].id == "8ff85c48fbd456f1"
%s[0].name == "whoisguard protected"
%s[0].organization == "WhoisGuard, Inc."
%s[0].address == "P.O. Box 0823-03411"
%s[0].city == "Panama"
%s[0].zip == "00000"
%s[0].state == "Panama"
%s[0].country == nil
%s[0].country_code == "PA"
%s[0].phone == "+507.8365503"
%s[0].fax == "+51.17057182"
%s[0].email == "[email protected]"
%s[0].created_on == nil
%s[0].updated_on == nil


#nameservers
%s %CLASS{array}
%s %SIZE{5}
%s[0] %CLASS{nameserver}
%s[0].name == "dns5.registrar-servers.com"
%s[0].ipv4 == nil
%s[0].ipv6 == nil
%s[1] %CLASS{nameserver}
%s[1].name == "dns3.registrar-servers.com"
%s[1].ipv4 == nil
%s[1].ipv6 == nil
%s[2] %CLASS{nameserver}
%s[2].name == "dns2.registrar-servers.com"
%s[2].ipv4 == nil
%s[2].ipv6 == nil
%s[3] %CLASS{nameserver}
%s[3].name == "dns1.registrar-servers.com"
%s[3].ipv4 == nil
%s[3].ipv6 == nil
%s[4] %CLASS{nameserver}
%s[4].name == "dns4.registrar-servers.com"
%s[4].ipv4 == nil
%s[4].ipv6 == nil
59 changes: 59 additions & 0 deletions spec/fixtures/responses/whois.donuts.co/bike/status_registered.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Domain Name: whereismy.bike
Domain ID: C52CECC9AF044831A7335E8A0ECBC349-D
WHOIS Server: http://www.enom.com
Referral URL: http://www.enom.com
Updated Date: 2014-02-21T22:55:08Z
Creation Date: 2014-02-21T22:55:07Z
Registry Expiry Date: 2015-02-21T22:55:07Z
Sponsoring Registrar: Enom, Inc.
Sponsoring Registrar IANA ID: 48
DomainStatus: clientTransferProhibited
Registrant ID: 8ff85c48fbd456f1
Registrant Name: whoisguard protected
Registrant Organization: WhoisGuard, Inc.
Registrant Street: P.O. Box 0823-03411
Registrant City: Panama
Registrant State/Province: Panama
Registrant Postal Code: 00000
Registrant Country: PA
Registrant Phone: +507.8365503
Registrant Phone Ext:
Registrant Fax: +51.17057182
Registrant Fax Ext:
Registrant Email: [email protected]
Admin ID: 8ff85c48fbd456f1
Admin Name: whoisguard protected
Admin Organization: WhoisGuard, Inc.
Admin Street: P.O. Box 0823-03411
Admin City: Panama
Admin State/Province: Panama
Admin Postal Code: 00000
Admin Country: PA
Admin Phone: +507.8365503
Admin Phone Ext:
Admin Fax: +51.17057182
Admin Fax Ext:
Admin Email: [email protected]
Tech ID: 8ff85c48fbd456f1
Tech Name: whoisguard protected
Tech Organization: WhoisGuard, Inc.
Tech Street: P.O. Box 0823-03411
Tech City: Panama
Tech State/Province: Panama
Tech Postal Code: 00000
Tech Country: PA
Tech Phone: +507.8365503
Tech Phone Ext:
Tech Fax: +51.17057182
Tech Fax Ext:
Tech Email: [email protected]
Name Server: dns5.registrar-servers.com
Name Server: dns3.registrar-servers.com
Name Server: dns2.registrar-servers.com
Name Server: dns1.registrar-servers.com
Name Server: dns4.registrar-servers.com
DNSSEC: unsigned

>>> Last update of WHOIS database: 2014-03-10T16:17:21Z <<<

Terms of Use: Users accessing the Donuts WHOIS service must agree to use the data only for lawful purposes, and under under no circumstances use the data to: Allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the registrar's own existing customers. Enable high volume, automated, electronic processes that send queries or data to the systems of Donuts or any ICANN-accredited registrar, except as reasonably necessary to register domain names or modify existing registrations. When using the Donuts Whois service, please consider the following: The Whois service is not a replacement for standard EPP commands to the SRS service. Whois is not considered authoritative for registered domain objects. The Whois service may be scheduled for downtime during production or OT&E maintenance periods. Queries to the Whois services are throttled. If too many queries are received from a single IP address within a specified time, the service will begin to reject further queries for a period of time to prevent disruption of Whois service access.
Loading

0 comments on commit 3b6688b

Please sign in to comment.