weppos/whois-parser

Parser whois.kg Unable to find a parser for property `expires_on'

Closed this issue · 1 comments

Hi guys! Thanks for your work! I apologize for English in advance, Google helped me.
I have such a script to view the term of domain delegation

#!/usr/bin/env ruby
require 'whois-parser'
record = Whois.whois(ARGV[0])
parser = record.parser
expire = parser.expires_on.strftime("%Y-%m-%d")
today = Time.now.strftime("%Y-%m-%d")
expire_date = DateTime.parse(expire)
today_date = DateTime.parse(today)
left = (expire_date - today_date).to_i
puts left

But he gives such an error

root@mypc:/etc/scripts# ./domain_left.rb elcat.kg
/var/lib/gems/2.3.0/gems/whois-parser-1.1.0/lib/whois/parser.rb:365:in `delegate_property_to_parsers': Unable to find a parser for property `expires_on' (Whois::AttributeNotImplemented)
        from /var/lib/gems/2.3.0/gems/whois-parser-1.1.0/lib/whois/parser.rb:327:in `expires_on'
        from /var/lib/gems/2.3.0/gems/whois-parser-1.1.0/lib/whois/parser.rb:348:in `method_missing'
        from ./domain_left.rb:7:in `<main>'

Please tell me what is the problem? After all, whois.kg support is enabled on 28 Mar 2017

Duplicate of #48