whois-parser 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +14 -8
- data/CONTRIBUTING.md +21 -7
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/whois-parser.rb +1 -1
- data/lib/whois/parser.rb +16 -1
- data/lib/whois/parser/version.rb +1 -1
- data/lib/whois/parsers/base.rb +1 -1
- data/lib/whois/parsers/base_afilias.rb +2 -2
- data/lib/whois/parsers/base_afilias2.rb +1 -1
- data/lib/whois/parsers/base_cocca.rb +4 -4
- data/lib/whois/parsers/base_cocca2.rb +2 -2
- data/lib/whois/parsers/base_icann_compliant.rb +1 -1
- data/lib/whois/parsers/base_icb.rb +1 -1
- data/lib/whois/parsers/base_iisse.rb +1 -1
- data/lib/whois/parsers/base_nic_fr.rb +3 -3
- data/lib/whois/parsers/base_shared1.rb +1 -1
- data/lib/whois/parsers/base_shared2.rb +1 -1
- data/lib/whois/parsers/base_shared3.rb +1 -1
- data/lib/whois/parsers/base_verisign.rb +1 -1
- data/lib/whois/parsers/base_whoisd.rb +2 -2
- data/lib/whois/parsers/blank.rb +1 -1
- data/lib/whois/parsers/capetown-whois.registry.net.za.rb +1 -1
- data/lib/whois/parsers/ccwhois.ksregistry.net.rb +1 -1
- data/lib/whois/parsers/ccwhois.verisign-grs.com.rb +1 -1
- data/lib/whois/parsers/coza-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/durban-whois.registry.net.za.rb +1 -1
- data/lib/whois/parsers/example.rb +1 -1
- data/lib/whois/parsers/joburg-whois.registry.net.za.rb +1 -1
- data/lib/whois/parsers/kero.yachay.pe.rb +3 -3
- data/lib/whois/parsers/org-whois.registry.net.za.rb +1 -1
- data/lib/whois/parsers/tvwhois.verisign-grs.com.rb +1 -1
- data/lib/whois/parsers/whois.1und1.info.rb +1 -1
- data/lib/whois/parsers/whois.35.com.rb +1 -1
- data/lib/whois/parsers/whois.aeda.net.ae.rb +2 -2
- data/lib/whois/parsers/whois.aero.rb +1 -1
- data/lib/whois/parsers/whois.afilias-grs.info.rb +1 -1
- data/lib/whois/parsers/whois.afilias.net.rb +1 -1
- data/lib/whois/parsers/whois.amnic.net.rb +2 -2
- data/lib/whois/parsers/whois.ascio.com.rb +1 -1
- data/lib/whois/parsers/whois.ati.tn.rb +1 -1
- data/lib/whois/parsers/whois.audns.net.au.rb +1 -1
- data/lib/whois/parsers/whois.ax.rb +1 -1
- data/lib/whois/parsers/whois.biz.rb +12 -3
- data/lib/whois/parsers/whois.bnnic.bn.rb +1 -1
- data/lib/whois/parsers/whois.cat.rb +1 -1
- data/lib/whois/parsers/whois.cctld.by.rb +1 -1
- data/lib/whois/parsers/whois.cctld.uz.rb +2 -2
- data/lib/whois/parsers/whois.cdmon.com.rb +1 -1
- data/lib/whois/parsers/whois.centralnic.com.rb +1 -1
- data/lib/whois/parsers/whois.cira.ca.rb +4 -4
- data/lib/whois/parsers/whois.cmc.iq.rb +1 -1
- data/lib/whois/parsers/whois.cnnic.cn.rb +1 -1
- data/lib/whois/parsers/whois.co.ca.rb +1 -1
- data/lib/whois/parsers/whois.co.pl.rb +1 -1
- data/lib/whois/parsers/whois.co.ug.rb +2 -2
- data/lib/whois/parsers/whois.comlaude.com.rb +1 -1
- data/lib/whois/parsers/whois.corporatedomains.com.rb +1 -1
- data/lib/whois/parsers/whois.denic.de.rb +2 -2
- data/lib/whois/parsers/whois.dk-hostmaster.dk.rb +2 -2
- data/lib/whois/parsers/whois.dns.be.rb +3 -3
- data/lib/whois/parsers/whois.dns.hr.rb +1 -1
- data/lib/whois/parsers/whois.dns.lu.rb +2 -2
- data/lib/whois/parsers/whois.dns.pl.rb +1 -1
- data/lib/whois/parsers/whois.dns.pt.rb +2 -2
- data/lib/whois/parsers/whois.domain-registry.nl.rb +2 -2
- data/lib/whois/parsers/whois.domain.kg.rb +1 -1
- data/lib/whois/parsers/whois.domainregistry.ie.rb +2 -2
- data/lib/whois/parsers/whois.domreg.lt.rb +1 -1
- data/lib/whois/parsers/whois.donuts.co.rb +1 -1
- data/lib/whois/parsers/whois.dot.cf.rb +1 -1
- data/lib/whois/parsers/whois.dot.tk.rb +1 -1
- data/lib/whois/parsers/whois.dotgov.gov.rb +2 -2
- data/lib/whois/parsers/whois.dotmobiregistry.net.rb +1 -1
- data/lib/whois/parsers/whois.dotpostregistry.net.rb +1 -1
- data/lib/whois/parsers/whois.dreamhost.com.rb +1 -1
- data/lib/whois/parsers/whois.educause.edu.rb +2 -2
- data/lib/whois/parsers/whois.eenet.ee.rb +1 -1
- data/lib/whois/parsers/whois.enom.com.rb +1 -1
- data/lib/whois/parsers/whois.eu.org.rb +1 -1
- data/lib/whois/parsers/whois.eu.rb +2 -2
- data/lib/whois/parsers/whois.fi.rb +2 -2
- data/lib/whois/parsers/whois.gandi.net.rb +1 -1
- data/lib/whois/parsers/whois.gg.rb +1 -1
- data/lib/whois/parsers/whois.godaddy.com.rb +1 -1
- data/lib/whois/parsers/whois.gov.za.rb +1 -1
- data/lib/whois/parsers/whois.hkirc.hk.rb +1 -1
- data/lib/whois/parsers/whois.iana.org.rb +1 -1
- data/lib/whois/parsers/whois.iis.nu.rb +1 -1
- data/lib/whois/parsers/whois.iis.se.rb +1 -1
- data/lib/whois/parsers/whois.in.ua.rb +2 -2
- data/lib/whois/parsers/whois.inregistry.net.rb +1 -1
- data/lib/whois/parsers/whois.isnic.is.rb +1 -1
- data/lib/whois/parsers/whois.isoc.org.il.rb +2 -2
- data/lib/whois/parsers/whois.ja.net.rb +1 -1
- data/lib/whois/parsers/whois.je.rb +1 -1
- data/lib/whois/parsers/whois.jprs.jp.rb +3 -3
- data/lib/whois/parsers/whois.kenic.or.ke.rb +3 -3
- data/lib/whois/parsers/whois.kr.rb +1 -1
- data/lib/whois/parsers/whois.markmonitor.com.rb +1 -1
- data/lib/whois/parsers/whois.monic.mo.rb +1 -1
- data/lib/whois/parsers/whois.museum.rb +1 -1
- data/lib/whois/parsers/whois.mynic.my.rb +1 -1
- data/lib/whois/parsers/whois.na-nic.com.na.rb +1 -1
- data/lib/whois/parsers/whois.nc.rb +1 -1
- data/lib/whois/parsers/whois.netcom.cm.rb +1 -1
- data/lib/whois/parsers/whois.networksolutions.com.rb +1 -1
- data/lib/whois/parsers/whois.nic.ac.rb +1 -1
- data/lib/whois/parsers/whois.nic.af.rb +1 -1
- data/lib/whois/parsers/whois.nic.ag.rb +1 -1
- data/lib/whois/parsers/{whois.ai.rb → whois.nic.ai.rb} +3 -3
- data/lib/whois/parsers/whois.nic.as.rb +1 -1
- data/lib/whois/parsers/whois.nic.asia.rb +1 -1
- data/lib/whois/parsers/whois.nic.at.rb +1 -1
- data/lib/whois/parsers/whois.nic.bj.rb +1 -1
- data/lib/whois/parsers/whois.nic.bo.rb +1 -1
- data/lib/whois/parsers/whois.nic.cd.rb +1 -1
- data/lib/whois/parsers/whois.nic.ch.rb +1 -1
- data/lib/whois/parsers/whois.nic.ci.rb +1 -1
- data/lib/whois/parsers/whois.nic.cl.rb +1 -1
- data/lib/whois/parsers/whois.nic.co.rb +1 -1
- data/lib/whois/parsers/whois.nic.college.rb +1 -1
- data/lib/whois/parsers/whois.nic.coop.rb +1 -1
- data/lib/whois/parsers/whois.nic.cx.rb +1 -1
- data/lib/whois/parsers/whois.nic.cz.rb +1 -1
- data/lib/whois/parsers/whois.nic.design.rb +1 -1
- data/lib/whois/parsers/whois.nic.dm.rb +1 -1
- data/lib/whois/parsers/whois.nic.dz.rb +1 -1
- data/lib/whois/parsers/whois.nic.ec.rb +2 -2
- data/lib/whois/parsers/whois.nic.es.rb +1 -1
- data/lib/whois/parsers/whois.nic.fm.rb +18 -0
- data/lib/whois/parsers/whois.nic.fo.rb +1 -1
- data/lib/whois/parsers/whois.nic.fr.rb +1 -1
- data/lib/whois/parsers/whois.nic.gd.rb +1 -1
- data/lib/whois/parsers/whois.nic.gl.rb +1 -1
- data/lib/whois/parsers/whois.nic.gs.rb +1 -1
- data/lib/whois/parsers/whois.nic.hn.rb +1 -1
- data/lib/whois/parsers/whois.nic.ht.rb +1 -1
- data/lib/whois/parsers/whois.nic.hu.rb +1 -1
- data/lib/whois/parsers/whois.nic.im.rb +1 -1
- data/lib/whois/parsers/whois.nic.io.rb +1 -1
- data/lib/whois/parsers/whois.nic.ir.rb +1 -1
- data/lib/whois/parsers/whois.nic.it.rb +2 -2
- data/lib/whois/parsers/whois.nic.jobs.rb +1 -1
- data/lib/whois/parsers/whois.nic.ki.rb +1 -1
- data/lib/whois/parsers/whois.nic.kz.rb +1 -1
- data/lib/whois/parsers/whois.nic.la.rb +1 -1
- data/lib/whois/parsers/whois.nic.li.rb +1 -1
- data/lib/whois/parsers/whois.nic.lk.rb +1 -1
- data/lib/whois/parsers/whois.nic.lv.rb +1 -1
- data/lib/whois/parsers/whois.nic.ly.rb +1 -1
- data/lib/whois/parsers/whois.nic.md.rb +1 -1
- data/lib/whois/parsers/whois.nic.me.rb +1 -1
- data/lib/whois/parsers/whois.nic.mg.rb +1 -1
- data/lib/whois/parsers/whois.nic.ms.rb +1 -1
- data/lib/whois/parsers/whois.nic.mu.rb +1 -1
- data/lib/whois/parsers/whois.nic.mx.rb +1 -1
- data/lib/whois/parsers/whois.nic.name.rb +1 -1
- data/lib/whois/parsers/whois.nic.net.ng.rb +1 -1
- data/lib/whois/parsers/whois.nic.net.sa.rb +1 -1
- data/lib/whois/parsers/whois.nic.net.sb.rb +1 -1
- data/lib/whois/parsers/whois.nic.nf.rb +1 -1
- data/lib/whois/parsers/whois.nic.org.uy.rb +2 -2
- data/lib/whois/parsers/whois.nic.pm.rb +1 -1
- data/lib/whois/parsers/whois.nic.pr.rb +1 -1
- data/lib/whois/parsers/whois.nic.priv.at.rb +1 -1
- data/lib/whois/parsers/whois.nic.pw.rb +1 -1
- data/lib/whois/parsers/whois.nic.re.rb +1 -1
- data/lib/whois/parsers/whois.nic.sh.rb +1 -1
- data/lib/whois/parsers/whois.nic.sl.rb +1 -1
- data/lib/whois/parsers/whois.nic.sm.rb +2 -2
- data/lib/whois/parsers/whois.nic.sn.rb +1 -1
- data/lib/whois/parsers/whois.nic.so.rb +1 -1
- data/lib/whois/parsers/whois.nic.space.rb +1 -1
- data/lib/whois/parsers/whois.nic.st.rb +10 -10
- data/lib/whois/parsers/whois.nic.tc.rb +1 -1
- data/lib/whois/parsers/whois.nic.tech.rb +1 -1
- data/lib/whois/parsers/whois.nic.tel.rb +1 -1
- data/lib/whois/parsers/whois.nic.tl.rb +1 -1
- data/lib/whois/parsers/whois.nic.tm.rb +1 -1
- data/lib/whois/parsers/whois.nic.tr.rb +1 -1
- data/lib/whois/parsers/whois.nic.travel.rb +1 -1
- data/lib/whois/parsers/whois.nic.uk.rb +2 -2
- data/lib/whois/parsers/whois.nic.us.rb +1 -1
- data/lib/whois/parsers/whois.nic.ve.rb +2 -2
- data/lib/whois/parsers/whois.nic.wf.rb +1 -1
- data/lib/whois/parsers/whois.nic.xxx.rb +1 -1
- data/lib/whois/parsers/whois.nic.xyz.rb +1 -1
- data/lib/whois/parsers/whois.norid.no.rb +1 -1
- data/lib/whois/parsers/whois.pairnic.com.rb +1 -1
- data/lib/whois/parsers/whois.pandi.or.id.rb +1 -1
- data/lib/whois/parsers/whois.pir.org.rb +1 -1
- data/lib/whois/parsers/whois.pnina.ps.rb +1 -1
- data/lib/whois/parsers/whois.register.bg.rb +2 -2
- data/lib/whois/parsers/whois.register.com.rb +1 -1
- data/lib/whois/parsers/whois.register.si.rb +2 -2
- data/lib/whois/parsers/whois.registre.ma.rb +7 -9
- data/lib/whois/parsers/whois.registro.br.rb +53 -9
- data/lib/whois/parsers/whois.registry.gy.rb +1 -1
- data/lib/whois/parsers/whois.registry.hm.rb +1 -1
- data/lib/whois/parsers/whois.registry.om.rb +1 -1
- data/lib/whois/parsers/whois.registry.qa.rb +1 -1
- data/lib/whois/parsers/whois.ripe.net.rb +1 -1
- data/lib/whois/parsers/whois.rnids.rs.rb +2 -2
- data/lib/whois/parsers/whois.rotld.ro.rb +2 -2
- data/lib/whois/parsers/whois.rrpproxy.net.rb +1 -1
- data/lib/whois/parsers/whois.safenames.net.rb +1 -1
- data/lib/whois/parsers/whois.schlund.info.rb +1 -1
- data/lib/whois/parsers/whois.sgnic.sg.rb +2 -2
- data/lib/whois/parsers/whois.sk-nic.sk.rb +2 -2
- data/lib/whois/parsers/whois.smallregistry.net.rb +2 -2
- data/lib/whois/parsers/whois.srs.net.nz.rb +3 -3
- data/lib/whois/parsers/whois.sx.rb +2 -2
- data/lib/whois/parsers/whois.tcinet.ru.rb +1 -1
- data/lib/whois/parsers/whois.thnic.co.th.rb +2 -2
- data/lib/whois/parsers/whois.tld.ee.rb +1 -1
- data/lib/whois/parsers/whois.tld.sy.rb +1 -1
- data/lib/whois/parsers/whois.tonic.to.rb +1 -1
- data/lib/whois/parsers/whois.tucows.com.rb +1 -1
- data/lib/whois/parsers/whois.twnic.net.tw.rb +1 -1
- data/lib/whois/parsers/whois.tznic.or.tz.rb +1 -1
- data/lib/whois/parsers/whois.ua.rb +3 -3
- data/lib/whois/parsers/whois.udag.net.rb +1 -1
- data/lib/whois/parsers/whois.uniregistry.net.rb +1 -1
- data/lib/whois/parsers/whois.usp.ac.fj.rb +2 -2
- data/lib/whois/parsers/whois.verisign-grs.com.rb +1 -1
- data/lib/whois/parsers/whois.website.ws.rb +1 -1
- data/lib/whois/parsers/whois.wildwestdomains.com.rb +1 -1
- data/lib/whois/parsers/whois.yoursrs.com.rb +1 -1
- data/lib/whois/parsers/whois.za.net.rb +1 -1
- data/lib/whois/parsers/whois.za.org.rb +1 -1
- data/lib/whois/parsers/whois1.nic.bi.rb +1 -1
- data/lib/whois/parsers/za_central_registry.rb +12 -1
- data/lib/whois/scanners/whois.cira.ca.rb +1 -1
- data/whois-parser.gemspec +3 -3
- metadata +10 -10
- data/lib/whois/parsers/whois.registry.net.za.rb +0 -139
- data/lib/whois/scanners/whois.registry.net.za.rb +0 -92
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -45,7 +45,7 @@ module Whois
|
|
45
45
|
when "renewal required."
|
46
46
|
:registered
|
47
47
|
else
|
48
|
-
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
|
48
|
+
Whois::Parser.bug!(ParserError, "Unknown status `#{$1}'.")
|
49
49
|
end
|
50
50
|
elsif invalid?
|
51
51
|
:invalid
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -34,7 +34,7 @@ module Whois
|
|
34
34
|
when "suspendido"
|
35
35
|
:inactive
|
36
36
|
else
|
37
|
-
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
|
37
|
+
Whois::Parser.bug!(ParserError, "Unknown status `#{$1}'.")
|
38
38
|
end
|
39
39
|
else
|
40
40
|
:available
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -30,7 +30,7 @@ module Whois
|
|
30
30
|
when "registered"
|
31
31
|
:registered
|
32
32
|
else
|
33
|
-
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
|
33
|
+
Whois::Parser.bug!(ParserError, "Unknown status `#{$1}'.")
|
34
34
|
end
|
35
35
|
else
|
36
36
|
:available
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -30,7 +30,7 @@ module Whois
|
|
30
30
|
if statuses.include?("server_update_prohibited")
|
31
31
|
:registered
|
32
32
|
else
|
33
|
-
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
|
33
|
+
Whois::Parser.bug!(ParserError, "Unknown status `#{$1}'.")
|
34
34
|
end
|
35
35
|
else
|
36
36
|
:available
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -13,16 +13,14 @@ require_relative 'base'
|
|
13
13
|
module Whois
|
14
14
|
class Parsers
|
15
15
|
|
16
|
-
#
|
17
|
-
# = whois.registre.ma parser
|
18
|
-
#
|
19
16
|
# Parser for the whois.registre.ma server.
|
20
17
|
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
18
|
+
# @note This parser is just a stub and provides only a few basic methods
|
19
|
+
# to check for domain availability and get domain status.
|
20
|
+
# Please consider to contribute implementing missing methods.
|
21
|
+
#
|
22
|
+
# @see Whois::Parsers::Example
|
23
|
+
# The Example parser for the list of all available methods.
|
26
24
|
#
|
27
25
|
class WhoisRegistreMa < Base
|
28
26
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -13,16 +13,14 @@ require_relative 'base'
|
|
13
13
|
module Whois
|
14
14
|
class Parsers
|
15
15
|
|
16
|
-
#
|
17
|
-
# = whois.registro.br parser
|
18
|
-
#
|
19
16
|
# Parser for the whois.registro.br server.
|
20
17
|
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
18
|
+
# @note This parser is just a stub and provides only a few basic methods
|
19
|
+
# to check for domain availability and get domain status.
|
20
|
+
# Please consider to contribute implementing missing methods.
|
21
|
+
#
|
22
|
+
# @see Whois::Parsers::Example
|
23
|
+
# The Example parser for the list of all available methods.
|
26
24
|
#
|
27
25
|
class WhoisRegistroBr < Base
|
28
26
|
|
@@ -42,6 +40,7 @@ module Whois
|
|
42
40
|
!available?
|
43
41
|
end
|
44
42
|
|
43
|
+
|
45
44
|
property_supported :created_on do
|
46
45
|
if content_for_scanner =~ /created:\s+(.+?)(\s+#.+)?\n/
|
47
46
|
parse_time($1)
|
@@ -60,6 +59,20 @@ module Whois
|
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
62
|
+
|
63
|
+
property_supported :registrant_contacts do
|
64
|
+
parse_contact("owner-c", Parser::Contact::TYPE_REGISTRANT)
|
65
|
+
end
|
66
|
+
|
67
|
+
property_supported :admin_contacts do
|
68
|
+
parse_contact("admin-c", Parser::Contact::TYPE_ADMINISTRATIVE)
|
69
|
+
end
|
70
|
+
|
71
|
+
property_supported :technical_contacts do
|
72
|
+
parse_contact("tech-c", Parser::Contact::TYPE_TECHNICAL)
|
73
|
+
end
|
74
|
+
|
75
|
+
|
63
76
|
property_supported :nameservers do
|
64
77
|
content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
|
65
78
|
name, ipv4 = line.strip.split(" ")
|
@@ -67,6 +80,37 @@ module Whois
|
|
67
80
|
end
|
68
81
|
end
|
69
82
|
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
def parse_contact(element, type)
|
87
|
+
return unless content_for_scanner =~ /#{element}:\s+(.+)\n/
|
88
|
+
|
89
|
+
id = $1
|
90
|
+
content_for_scanner.scan(/nic-hdl-br:\s+#{id}\n((.+\n)+)\n/).any? ||
|
91
|
+
Whois.bug!(ParserError, "Unable to parse contact block for nic-hdl-br: #{id}")
|
92
|
+
values = build_hash($1.scan(/(.+?):\s+(.+?)\n/))
|
93
|
+
|
94
|
+
created_on = values["created"] ? Time.utc(*values["created"][0..3],*values["created"][4..5],*values["created"][6..7]) : nil
|
95
|
+
updated_on = values["changed"] ? Time.utc(*values["changed"][0..3],*values["changed"][4..5],*values["changed"][6..7]) : nil
|
96
|
+
|
97
|
+
Parser::Contact.new({
|
98
|
+
type: type,
|
99
|
+
id: id,
|
100
|
+
name: values["person"],
|
101
|
+
email: values["e-mail"],
|
102
|
+
created_on: created_on,
|
103
|
+
updated_on: updated_on
|
104
|
+
})
|
105
|
+
end
|
106
|
+
|
107
|
+
def build_hash(tokens)
|
108
|
+
{}.tap do |hash|
|
109
|
+
tokens.each do |key, value|
|
110
|
+
hash[key] = value
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
70
114
|
end
|
71
115
|
|
72
116
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -48,7 +48,7 @@ module Whois
|
|
48
48
|
when 'expired'
|
49
49
|
:expired
|
50
50
|
else
|
51
|
-
Whois.bug!(ParserError, "Unknown status `#{node("Domain status")}'.")
|
51
|
+
Whois::Parser.bug!(ParserError, "Unknown status `#{node("Domain status")}'.")
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# An intelligent pure Ruby WHOIS client and parser.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2009-
|
6
|
+
# Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net>
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
@@ -30,7 +30,7 @@ module Whois
|
|
30
30
|
when "ok", "updateprohibited"
|
31
31
|
:registered
|
32
32
|
else
|
33
|
-
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
|
33
|
+
Whois::Parser.bug!(ParserError, "Unknown status `#{$1}'.")
|
34
34
|
end
|
35
35
|
else
|
36
36
|
:available
|