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

Retrieving contacts when executing WHOIS command on French domains results in an error #158

Open
ibalosh opened this issue Jul 25, 2023 · 1 comment

Comments

@ibalosh
Copy link

ibalosh commented Jul 25, 2023

Steps to reproduce

require "whois-parser"

response = Whois.whois("google.fr")
parser = response.parser
parser.contacts

Error message

...whois-parser-2.0.0/lib/whois/parsers/base_nic_fr.rb:139:in 
`utc': invalid value for Integer(): "2022-10-15T05:41:14.918179Z" (ArgumentError)

updated_on = values["changed"] ? Time.utc(*values["changed"].split(" ").first.split("/").reverse) : nil

Environment

Ruby: ruby-3.2.2 [ arm64 ]
Gem version: latest whois (5.1.0), whois-parser (2.0.0)

Note

When using ruby-3.0.0 [ arm64 ] , error will not be thrown.

@jarthod
Copy link

jarthod commented Aug 2, 2023

@ibalosh this gem is not maintained at the moment so after asking the maintainer I ended up starting my fork in which I merged some of the pending PRs and provided a lot more fixes.
This issue is not present in my fork:

irb(main):001:0> require "whois-parser"
=> true
irb(main):002:0> 
irb(main):003:0> response = Whois.whois("google.fr")
irb(main):004:0> parser = response.parser
=> 
#<Whois::Parser:0x00007efcb86b56c8
...
irb(main):005:0> parser.contacts
=> 
[#<struct Whois::Parser::Contact
  id="GIHU100-FRNIC",
  type=1,
  city=nil,
  zip=nil,
  state=nil,
  country=nil,
  country_code="IE",
  phone="+353.14361000",
  fax=nil,
  email="dns-admin@google.com",
  url=nil,
  created_on=nil,
  updated_on=Sat, 15 Oct 2022 05:41:14.000000000 UTC +00:00>,
 #<struct Whois::Parser::Contact
  id="GIHU101-FRNIC",
  type=2,
  name=nil,
  organization="Google Ireland Holdings Unlimited Company",
  address="70 Sir John Rogerson's Quay\n2 Dublin",
  city=nil,
  zip=nil,
  state=nil,
  country=nil,
  country_code="IE",
  phone="+353.14361000",
  fax=nil,
  email="dns-admin@google.com",
  url=nil,
  created_on=nil,
  updated_on=nil>,
 #<struct Whois::Parser::Contact
  id="MI3669-FRNIC",
  type=3,
  name=nil,
  organization="MarkMonitor Inc.",
  address="2150 S. Bonito Way, Suite 150\n83642 Meridian",
  city=nil,
  zip=nil,
  state=nil,
  country=nil,
  country_code="US",
  phone="+1.2083895740",
  fax="+1.2083895771",
  email="ccops@markmonitor.com",
  url=nil,
  created_on=nil,
  updated_on=Tue, 01 Aug 2023 16:08:06.000000000 UTC +00:00>]

So you can use my fork in the meantime and hopefully one day we'll be able to merge upstream:

gem 'whois-parser', github: 'jarthod/whois-parser' # Unofficial but more up-to-date fork, check status at https://github.com/jarthod/whois-parser

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

No branches or pull requests

2 participants