Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix corporatedomains whois date format with slashes #123

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion lib/whois/parsers/whois.corporatedomains.com.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module Whois
class Parsers

# Parser for the whois.markmonitor.com server.
# Parser for the whois.corporatedomains.com server.
#
# @see Whois::Parsers::Example
# The Example parser for the list of all available methods.
Expand All @@ -22,6 +22,41 @@ class WhoisCorporatedomainsCom < BaseIcannCompliant
self.scanner = Scanners::BaseIcannCompliant, {
pattern_available: /^No match for/
}

property_supported :created_on do
node("Creation Date") do |value|
if value.include?("/")
parse_time_with_slash_format(value)
else
parse_time(value)
end
end
end

property_supported :expires_on do
node("Registrar Registration Expiration Date") do |value|
if value.include?("/")
parse_time_with_slash_format(value)
else
parse_time(value)
end
end
end

private

# There are 2 different date formats which are used for creation and expiration dates:
# - hyphen-separated date format YYYY-MM-DDTHH:MM:SSZ
# - slash-separated date format MM/DD/YYYY HH:MM:SS
#
# The latter format causes problems because `parse_time` parsed as (DD/MM/YYYY HH:MM:SS), so it needs
# to be parsed differently.
def parse_time_with_slash_format(value)
date, time = value.split
month, day, year = date.split("/")

Time.utc(year, month, day, time)
end
end

end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#domain
%s == "corporatedomains.com"

#domain_id
%s == "2546326_DOMAIN_COM-VRSN"


#status
%s == :registered

#available?
%s == false

#registered?
%s == true


#created_on
%s %CLASS{time}
%s %TIME{1997-10-16 04:00:00 +0000}


#updated_on
%s %CLASS{time}
%s %TIME{2018-10-11 05:49:21 +0000}

#expires_on
%s %CLASS{time}
%s %TIME{2019-10-15 04:00:00 +0000}


#registrar
%s %CLASS{registrar}
%s.id == "299"
%s.name == "CSC CORPORATE DOMAINS, INC."
%s.organization == "CSC CORPORATE DOMAINS, INC."
%s.url == "www.cscprotectsbrands.com"


#registrant_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_REGISTRANT
%s[0].name == "Domain Administrator"
%s[0].organization == "CSC Corporate Domains, Inc."
%s[0].address == "251 Little Falls Drive"
%s[0].city == "Wilmington"
%s[0].zip == "19808"
%s[0].state == "DE"
%s[0].country_code == "US"
%s[0].phone == "+1.3026365400"
%s[0].fax == "+1.3026365454"
%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::Parser::Contact::TYPE_ADMINISTRATIVE
%s[0].name == "Domain Administrator"
%s[0].organization == "CSC Corporate Domains, Inc."
%s[0].address == "251 Little Falls Drive"
%s[0].city == "Wilmington"
%s[0].zip == "19808"
%s[0].state == "DE"
%s[0].country_code == "US"
%s[0].phone == "+1.3026365400"
%s[0].fax == "+1.3026365454"
%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::Parser::Contact::TYPE_TECHNICAL
%s[0].name == "DNS Administrator"
%s[0].organization == "CSC Corporate Domains, Inc."
%s[0].address == "251 Little Falls Drive"
%s[0].city == "Wilmington"
%s[0].zip == "19808"
%s[0].state == "DE"
%s[0].country_code == "US"
%s[0].phone == "+1.3026365400"
%s[0].fax == "+1.3026365454"
%s[0].email == "[email protected]"
%s[0].created_on == nil
%s[0].updated_on == nil


#nameservers
%s %CLASS{array}
%s %SIZE{2}
%s[0] %CLASS{nameserver}
%s[0].name == "pdns1.cscdns.net"
%s[0].ipv4 == nil
%s[0].ipv6 == nil
%s[1] %CLASS{nameserver}
%s[1].name == "pdns2.cscdns.net"
%s[1].ipv4 == nil
%s[1].ipv6 == nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

Domain Name: corporatedomains.com
Registry Domain ID: 2546326_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.corporatedomains.com
Registrar URL: www.cscprotectsbrands.com
Updated Date: 2018-10-11T05:49:21Z
Creation Date: 1997-10-16T04:00:00Z
Registrar Registration Expiration Date: 2019-10-15T04:00:00Z
Registrar: CSC CORPORATE DOMAINS, INC.
Registrar IANA ID: 299
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +1.8887802723
Domain Status: clientTransferProhibited http://www.icann.org/epp#clientTransferProhibited
Domain Status: serverDeleteProhibited http://www.icann.org/epp#serverDeleteProhibited
Domain Status: serverTransferProhibited http://www.icann.org/epp#serverTransferProhibited
Domain Status: serverUpdateProhibited http://www.icann.org/epp#serverUpdateProhibited
Registry Registrant ID:
Registrant Name: Domain Administrator
Registrant Organization: CSC Corporate Domains, Inc.
Registrant Street: 251 Little Falls Drive
Registrant City: Wilmington
Registrant State/Province: DE
Registrant Postal Code: 19808
Registrant Country: US
Registrant Phone: +1.3026365400
Registrant Phone Ext:
Registrant Fax: +1.3026365454
Registrant Fax Ext:
Registrant Email: [email protected]
Registry Admin ID:
Admin Name: Domain Administrator
Admin Organization: CSC Corporate Domains, Inc.
Admin Street: 251 Little Falls Drive
Admin City: Wilmington
Admin State/Province: DE
Admin Postal Code: 19808
Admin Country: US
Admin Phone: +1.3026365400
Admin Phone Ext:
Admin Fax: +1.3026365454
Admin Fax Ext:
Admin Email: [email protected]
Registry Tech ID:
Tech Name: DNS Administrator
Tech Organization: CSC Corporate Domains, Inc.
Tech Street: 251 Little Falls Drive
Tech City: Wilmington
Tech State/Province: DE
Tech Postal Code: 19808
Tech Country: US
Tech Phone: +1.3026365400
Tech Phone Ext:
Tech Fax: +1.3026365454
Tech Fax Ext:
Tech Email: [email protected]
Name Server: pdns1.cscdns.net
Name Server: pdns2.cscdns.net
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2018-10-11T05:49:21Z <<<

For more information on Whois status codes, please visit https://icann.org/epp

Corporation Service Company(c) (CSC) The Trusted Partner of More than 50% of the 100 Best Global Brands.

Contact us to learn more about our enterprise solutions for Global Domain Name Registration and Management, Trademark Research and Watching, Brand, Logo and Auction Monitoring, as well SSL Certificate Services and DNS Hosting.

NOTICE: You are not authorized to access or query our WHOIS database through the use of high-volume, automated, electronic processes or for the purpose or purposes of using the data in any manner that violates these terms of use. The Data in the CSC WHOIS database is provided by CSC for information purposes only, and to assist persons in obtaining information about or related to a domain name registration record. CSC does not guarantee its accuracy. By submitting a WHOIS query, you agree to abide by the following terms of use: you agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via direct mail, e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to CSC (or its computer systems). CSC reserves the right to terminate your access to the WHOIS database in its sole discretion for any violations by you of these terms of use. CSC reserves the right to modify these terms at any time.

Register your domain name at http://www.cscglobal.com
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#domain
%s == "corporatedomains.com"

#domain_id
%s == "2546326_DOMAIN_COM-VRSN"


#status
%s == :registered

#available?
%s == false

#registered?
%s == true


#created_on
%s %CLASS{time}
%s %TIME{1997-10-16 04:00:00 +0000}


#updated_on
%s %CLASS{time}
%s %TIME{2018-10-11 05:49:21 UTC}

#expires_on
%s %CLASS{time}
%s %TIME{2019-10-15 04:00:00 UTC}


#registrar
%s %CLASS{registrar}
%s.id == "299"
%s.name == "CSC CORPORATE DOMAINS, INC."
%s.organization == "CSC CORPORATE DOMAINS, INC."
%s.url == "www.cscprotectsbrands.com"


#registrant_contacts
%s %CLASS{array}
%s %SIZE{1}
%s[0] %CLASS{contact}
%s[0].type == Whois::Parser::Contact::TYPE_REGISTRANT
%s[0].name == "Domain Administrator"
%s[0].organization == "CSC Corporate Domains, Inc."
%s[0].address == "251 Little Falls Drive"
%s[0].city == "Wilmington"
%s[0].zip == "19808"
%s[0].state == "DE"
%s[0].country_code == "US"
%s[0].phone == "+1.3026365400"
%s[0].fax == "+1.3026365454"
%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::Parser::Contact::TYPE_ADMINISTRATIVE
%s[0].name == "Domain Administrator"
%s[0].organization == "CSC Corporate Domains, Inc."
%s[0].address == "251 Little Falls Drive"
%s[0].city == "Wilmington"
%s[0].zip == "19808"
%s[0].state == "DE"
%s[0].country_code == "US"
%s[0].phone == "+1.3026365400"
%s[0].fax == "+1.3026365454"
%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::Parser::Contact::TYPE_TECHNICAL
%s[0].name == "DNS Administrator"
%s[0].organization == "CSC Corporate Domains, Inc."
%s[0].address == "251 Little Falls Drive"
%s[0].city == "Wilmington"
%s[0].zip == "19808"
%s[0].state == "DE"
%s[0].country_code == "US"
%s[0].phone == "+1.3026365400"
%s[0].fax == "+1.3026365454"
%s[0].email == "[email protected]"
%s[0].created_on == nil
%s[0].updated_on == nil


#nameservers
%s %CLASS{array}
%s %SIZE{2}
%s[0] %CLASS{nameserver}
%s[0].name == "pdns1.cscdns.net"
%s[0].ipv4 == nil
%s[0].ipv6 == nil
%s[1] %CLASS{nameserver}
%s[1].name == "pdns2.cscdns.net"
%s[1].ipv4 == nil
%s[1].ipv6 == nil
Loading