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

Conversation

njng
Copy link

@njng njng commented Jun 25, 2019

Some of the responses return the creation/expiration date in a format that is parsed incorrectly through parse_time. This occurs specifically for corporatedomains in some instances where the date format is returned as "MM/DD/YYYY", but is interpreted as "DD/MM/YYYY" so these dates need to be parsed separately.

njng added 3 commits June 25, 2019 15:29
Updated the WHOIS parser for corporatedomains which were incorrectly
parsing "Registrar Registration Expiration Date", because the date had
"MM/DD/YYYY" format rather than "DD/MM/YYYY". The change updates
the format if the value has slash-separated date before passing it into
`parse_time`. This change cannot be used for all dates, since some dates
use a dash-separated format (i.e. YYYY-MM-DDTHH:MM:SSZ).

This problem also applies to the creation date as well when parsing the
value for "Creation Date".
Moved the existing `status_available` files into the `com` folder where
the new `status_registered` files will be generated. Generated new
`status_registered` files for the different cases when the
creation and expiration dates are hyphen-separated vs slash-separated.

Also re-used the existing `.expected` file from the old
`status_registered` file to test for the new values.
Return the result from `Time.utc` to parse dates using slash-format in
corporatedomains, since this would avoid using joins and string
interpolation before being passed into `parse_time`.

Renamed the method as the return value now returns a Time object rather
than a string.
@weppos
Copy link
Owner

weppos commented Jun 27, 2019

@njng can you explain how you generated the fixture with the dates with slashes? I performed a live whois query, but what I see is:

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

I can't find any domain that returns dates in MM/DD/YYYY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants