whois-parser 0.0.1 → 1.0.0.pre.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/CHANGELOG.md +20 -0
- data/CONTRIBUTING.md +40 -0
- data/LICENSE.txt +17 -18
- data/README.md +6 -24
- data/lib/whois/parser/contact.rb +56 -0
- data/lib/whois/parser/errors.rb +46 -0
- data/lib/whois/parser/nameserver.rb +39 -0
- data/lib/whois/parser/registrar.rb +25 -0
- data/lib/whois/parser/super_struct.rb +53 -0
- data/lib/whois/parser/version.rb +3 -2
- data/lib/whois/parser.rb +407 -3
- data/lib/whois/parser_extensions/whois.rb +78 -0
- data/lib/whois/parser_extensions/whois_record.rb +222 -0
- data/lib/whois/parser_extensions.rb +9 -0
- data/lib/whois/parsers/base.rb +412 -0
- data/lib/whois/parsers/base_afilias.rb +139 -0
- data/lib/whois/parsers/base_afilias2.rb +140 -0
- data/lib/whois/parsers/base_cocca.rb +97 -0
- data/lib/whois/parsers/base_cocca2.rb +91 -0
- data/lib/whois/parsers/base_icann_compliant.rb +150 -0
- data/lib/whois/parsers/base_icb.rb +92 -0
- data/lib/whois/parsers/base_iisse.rb +113 -0
- data/lib/whois/parsers/base_nic_fr.rb +169 -0
- data/lib/whois/parsers/base_shared1.rb +108 -0
- data/lib/whois/parsers/base_shared2.rb +127 -0
- data/lib/whois/parsers/base_shared3.rb +127 -0
- data/lib/whois/parsers/base_verisign.rb +106 -0
- data/lib/whois/parsers/base_whoisd.rb +145 -0
- data/lib/whois/parsers/blank.rb +35 -0
- data/lib/whois/parsers/capetown-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/ccwhois.ksregistry.net.rb +25 -0
- data/lib/whois/parsers/ccwhois.verisign-grs.com.rb +25 -0
- data/lib/whois/parsers/durban-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/example.rb +163 -0
- data/lib/whois/parsers/joburg-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/kero.yachay.pe.rb +86 -0
- data/lib/whois/parsers/org-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/tvwhois.verisign-grs.com.rb +25 -0
- data/lib/whois/parsers/whois.1und1.info.rb +28 -0
- data/lib/whois/parsers/whois.35.com.rb +23 -0
- data/lib/whois/parsers/whois.aeda.net.ae.rb +64 -0
- data/lib/whois/parsers/whois.aero.rb +58 -0
- data/lib/whois/parsers/whois.afilias-grs.info.rb +21 -0
- data/lib/whois/parsers/whois.afilias.net.rb +41 -0
- data/lib/whois/parsers/whois.ai.rb +62 -0
- data/lib/whois/parsers/whois.amnic.net.rb +79 -0
- data/lib/whois/parsers/whois.ascio.com.rb +29 -0
- data/lib/whois/parsers/whois.ati.tn.rb +116 -0
- data/lib/whois/parsers/whois.audns.net.au.rb +118 -0
- data/lib/whois/parsers/whois.ax.rb +64 -0
- data/lib/whois/parsers/whois.biz.rb +25 -0
- data/lib/whois/parsers/whois.bnnic.bn.rb +75 -0
- data/lib/whois/parsers/whois.cat.rb +75 -0
- data/lib/whois/parsers/whois.cctld.by.rb +94 -0
- data/lib/whois/parsers/whois.cctld.uz.rb +79 -0
- data/lib/whois/parsers/whois.centralnic.com.rb +140 -0
- data/lib/whois/parsers/whois.cira.ca.rb +192 -0
- data/lib/whois/parsers/whois.cmc.iq.rb +25 -0
- data/lib/whois/parsers/whois.cnnic.cn.rb +108 -0
- data/lib/whois/parsers/whois.co.ca.rb +74 -0
- data/lib/whois/parsers/whois.co.pl.rb +82 -0
- data/lib/whois/parsers/whois.co.ug.rb +82 -0
- data/lib/whois/parsers/whois.comlaude.com.rb +113 -0
- data/lib/whois/parsers/whois.corporatedomains.com.rb +28 -0
- data/lib/whois/parsers/whois.denic.de.rb +164 -0
- data/lib/whois/parsers/whois.dk-hostmaster.dk.rb +88 -0
- data/lib/whois/parsers/whois.dns.be.rb +120 -0
- data/lib/whois/parsers/whois.dns.hr.rb +97 -0
- data/lib/whois/parsers/whois.dns.lu.rb +126 -0
- data/lib/whois/parsers/whois.dns.pl.rb +151 -0
- data/lib/whois/parsers/whois.dns.pt.rb +77 -0
- data/lib/whois/parsers/whois.domain-registry.nl.rb +123 -0
- data/lib/whois/parsers/whois.domain.kg.rb +76 -0
- data/lib/whois/parsers/whois.domainregistry.ie.rb +121 -0
- data/lib/whois/parsers/whois.domreg.lt.rb +68 -0
- data/lib/whois/parsers/whois.donuts.co.rb +61 -0
- data/lib/whois/parsers/whois.dot.cf.rb +71 -0
- data/lib/whois/parsers/whois.dot.tk.rb +70 -0
- data/lib/whois/parsers/whois.dotgov.gov.rb +61 -0
- data/lib/whois/parsers/whois.dotmobiregistry.net.rb +21 -0
- data/lib/whois/parsers/whois.dotpostregistry.net.rb +25 -0
- data/lib/whois/parsers/whois.dreamhost.com.rb +23 -0
- data/lib/whois/parsers/whois.educause.edu.rb +200 -0
- data/lib/whois/parsers/whois.eenet.ee.rb +72 -0
- data/lib/whois/parsers/whois.enom.com.rb +34 -0
- data/lib/whois/parsers/whois.eu.org.rb +58 -0
- data/lib/whois/parsers/whois.eu.rb +130 -0
- data/lib/whois/parsers/whois.fi.rb +117 -0
- data/lib/whois/parsers/whois.gandi.net.rb +30 -0
- data/lib/whois/parsers/whois.gg.rb +31 -0
- data/lib/whois/parsers/whois.godaddy.com.rb +112 -0
- data/lib/whois/parsers/whois.gov.za.rb +60 -0
- data/lib/whois/parsers/whois.hkirc.hk.rb +70 -0
- data/lib/whois/parsers/whois.iana.org.rb +102 -0
- data/lib/whois/parsers/whois.iis.nu.rb +26 -0
- data/lib/whois/parsers/whois.iis.se.rb +26 -0
- data/lib/whois/parsers/whois.in.ua.rb +75 -0
- data/lib/whois/parsers/whois.inregistry.net.rb +27 -0
- data/lib/whois/parsers/whois.isnic.is.rb +70 -0
- data/lib/whois/parsers/whois.isoc.org.il.rb +75 -0
- data/lib/whois/parsers/whois.ja.net.rb +75 -0
- data/lib/whois/parsers/whois.je.rb +25 -0
- data/lib/whois/parsers/whois.jprs.jp.rb +103 -0
- data/lib/whois/parsers/whois.kenic.or.ke.rb +91 -0
- data/lib/whois/parsers/whois.kr.rb +79 -0
- data/lib/whois/parsers/whois.markmonitor.com.rb +36 -0
- data/lib/whois/parsers/whois.monic.mo.rb +83 -0
- data/lib/whois/parsers/whois.museum.rb +79 -0
- data/lib/whois/parsers/whois.mynic.my.rb +72 -0
- data/lib/whois/parsers/whois.na-nic.com.na.rb +21 -0
- data/lib/whois/parsers/whois.nc.rb +122 -0
- data/lib/whois/parsers/whois.netcom.cm.rb +26 -0
- data/lib/whois/parsers/whois.networksolutions.com.rb +37 -0
- data/lib/whois/parsers/whois.nic.ac.rb +25 -0
- data/lib/whois/parsers/whois.nic.af.rb +25 -0
- data/lib/whois/parsers/whois.nic.ag.rb +21 -0
- data/lib/whois/parsers/whois.nic.as.rb +63 -0
- data/lib/whois/parsers/whois.nic.asia.rb +107 -0
- data/lib/whois/parsers/whois.nic.at.rb +64 -0
- data/lib/whois/parsers/whois.nic.bj.rb +126 -0
- data/lib/whois/parsers/whois.nic.bo.rb +73 -0
- data/lib/whois/parsers/whois.nic.cd.rb +34 -0
- data/lib/whois/parsers/whois.nic.ch.rb +109 -0
- data/lib/whois/parsers/whois.nic.ci.rb +70 -0
- data/lib/whois/parsers/whois.nic.cl.rb +71 -0
- data/lib/whois/parsers/whois.nic.co.rb +25 -0
- data/lib/whois/parsers/whois.nic.college.rb +25 -0
- data/lib/whois/parsers/whois.nic.coop.rb +70 -0
- data/lib/whois/parsers/whois.nic.cx.rb +25 -0
- data/lib/whois/parsers/whois.nic.cz.rb +42 -0
- data/lib/whois/parsers/whois.nic.design.rb +25 -0
- data/lib/whois/parsers/whois.nic.dm.rb +25 -0
- data/lib/whois/parsers/whois.nic.dz.rb +58 -0
- data/lib/whois/parsers/whois.nic.ec.rb +34 -0
- data/lib/whois/parsers/whois.nic.es.rb +105 -0
- data/lib/whois/parsers/whois.nic.fo.rb +43 -0
- data/lib/whois/parsers/whois.nic.fr.rb +25 -0
- data/lib/whois/parsers/whois.nic.gd.rb +31 -0
- data/lib/whois/parsers/whois.nic.gl.rb +25 -0
- data/lib/whois/parsers/whois.nic.gs.rb +31 -0
- data/lib/whois/parsers/whois.nic.hn.rb +25 -0
- data/lib/whois/parsers/whois.nic.ht.rb +25 -0
- data/lib/whois/parsers/whois.nic.hu.rb +78 -0
- data/lib/whois/parsers/whois.nic.im.rb +66 -0
- data/lib/whois/parsers/whois.nic.io.rb +48 -0
- data/lib/whois/parsers/whois.nic.ir.rb +66 -0
- data/lib/whois/parsers/whois.nic.it.rb +159 -0
- data/lib/whois/parsers/whois.nic.jobs.rb +25 -0
- data/lib/whois/parsers/whois.nic.ki.rb +25 -0
- data/lib/whois/parsers/whois.nic.kz.rb +67 -0
- data/lib/whois/parsers/whois.nic.la.rb +25 -0
- data/lib/whois/parsers/whois.nic.li.rb +64 -0
- data/lib/whois/parsers/whois.nic.lk.rb +109 -0
- data/lib/whois/parsers/whois.nic.lv.rb +65 -0
- data/lib/whois/parsers/whois.nic.ly.rb +76 -0
- data/lib/whois/parsers/whois.nic.md.rb +94 -0
- data/lib/whois/parsers/whois.nic.me.rb +85 -0
- data/lib/whois/parsers/whois.nic.mg.rb +31 -0
- data/lib/whois/parsers/whois.nic.ms.rb +25 -0
- data/lib/whois/parsers/whois.nic.mu.rb +25 -0
- data/lib/whois/parsers/whois.nic.mx.rb +79 -0
- data/lib/whois/parsers/whois.nic.name.rb +68 -0
- data/lib/whois/parsers/whois.nic.net.ng.rb +27 -0
- data/lib/whois/parsers/whois.nic.net.sa.rb +70 -0
- data/lib/whois/parsers/whois.nic.net.sb.rb +31 -0
- data/lib/whois/parsers/whois.nic.nf.rb +25 -0
- data/lib/whois/parsers/whois.nic.org.uy.rb +75 -0
- data/lib/whois/parsers/whois.nic.pm.rb +25 -0
- data/lib/whois/parsers/whois.nic.pr.rb +84 -0
- data/lib/whois/parsers/whois.nic.priv.at.rb +62 -0
- data/lib/whois/parsers/whois.nic.pw.rb +25 -0
- data/lib/whois/parsers/whois.nic.re.rb +25 -0
- data/lib/whois/parsers/whois.nic.sh.rb +25 -0
- data/lib/whois/parsers/whois.nic.sl.rb +76 -0
- data/lib/whois/parsers/whois.nic.sm.rb +76 -0
- data/lib/whois/parsers/whois.nic.sn.rb +113 -0
- data/lib/whois/parsers/whois.nic.so.rb +70 -0
- data/lib/whois/parsers/whois.nic.space.rb +25 -0
- data/lib/whois/parsers/whois.nic.st.rb +72 -0
- data/lib/whois/parsers/whois.nic.tc.rb +25 -0
- data/lib/whois/parsers/whois.nic.tech.rb +25 -0
- data/lib/whois/parsers/whois.nic.tel.rb +25 -0
- data/lib/whois/parsers/whois.nic.tl.rb +25 -0
- data/lib/whois/parsers/whois.nic.tm.rb +31 -0
- data/lib/whois/parsers/whois.nic.tr.rb +159 -0
- data/lib/whois/parsers/whois.nic.travel.rb +25 -0
- data/lib/whois/parsers/whois.nic.uk.rb +177 -0
- data/lib/whois/parsers/whois.nic.us.rb +25 -0
- data/lib/whois/parsers/whois.nic.ve.rb +87 -0
- data/lib/whois/parsers/whois.nic.wf.rb +25 -0
- data/lib/whois/parsers/whois.nic.xxx.rb +42 -0
- data/lib/whois/parsers/whois.nic.xyz.rb +25 -0
- data/lib/whois/parsers/whois.norid.no.rb +61 -0
- data/lib/whois/parsers/whois.pairnic.com.rb +28 -0
- data/lib/whois/parsers/whois.pandi.or.id.rb +25 -0
- data/lib/whois/parsers/whois.pir.org.rb +90 -0
- data/lib/whois/parsers/whois.pnina.ps.rb +31 -0
- data/lib/whois/parsers/whois.register.bg.rb +83 -0
- data/lib/whois/parsers/whois.register.com.rb +30 -0
- data/lib/whois/parsers/whois.register.si.rb +73 -0
- data/lib/whois/parsers/whois.registre.ma.rb +63 -0
- data/lib/whois/parsers/whois.registro.br.rb +73 -0
- data/lib/whois/parsers/whois.registry.gy.rb +25 -0
- data/lib/whois/parsers/whois.registry.hm.rb +72 -0
- data/lib/whois/parsers/whois.registry.net.za.rb +139 -0
- data/lib/whois/parsers/whois.registry.om.rb +40 -0
- data/lib/whois/parsers/whois.registry.qa.rb +25 -0
- data/lib/whois/parsers/whois.ripe.net.rb +68 -0
- data/lib/whois/parsers/whois.rnids.rs.rb +134 -0
- data/lib/whois/parsers/whois.rotld.ro.rb +65 -0
- data/lib/whois/parsers/whois.rrpproxy.net.rb +32 -0
- data/lib/whois/parsers/whois.safenames.net.rb +48 -0
- data/lib/whois/parsers/whois.schlund.info.rb +34 -0
- data/lib/whois/parsers/whois.sgnic.sg.rb +87 -0
- data/lib/whois/parsers/whois.sk-nic.sk.rb +101 -0
- data/lib/whois/parsers/whois.smallregistry.net.rb +131 -0
- data/lib/whois/parsers/whois.srs.net.nz.rb +159 -0
- data/lib/whois/parsers/whois.sx.rb +127 -0
- data/lib/whois/parsers/whois.tcinet.ru.rb +114 -0
- data/lib/whois/parsers/whois.thnic.co.th.rb +79 -0
- data/lib/whois/parsers/whois.tld.ee.rb +134 -0
- data/lib/whois/parsers/whois.tld.sy.rb +34 -0
- data/lib/whois/parsers/whois.tonic.to.rb +86 -0
- data/lib/whois/parsers/whois.tucows.com.rb +28 -0
- data/lib/whois/parsers/whois.twnic.net.tw.rb +72 -0
- data/lib/whois/parsers/whois.tznic.or.tz.rb +25 -0
- data/lib/whois/parsers/whois.ua.rb +240 -0
- data/lib/whois/parsers/whois.udag.net.rb +28 -0
- data/lib/whois/parsers/whois.uniregistry.net.rb +61 -0
- data/lib/whois/parsers/whois.usp.ac.fj.rb +72 -0
- data/lib/whois/parsers/whois.verisign-grs.com.rb +49 -0
- data/lib/whois/parsers/whois.website.ws.rb +74 -0
- data/lib/whois/parsers/whois.wildwestdomains.com.rb +37 -0
- data/lib/whois/parsers/whois.yoursrs.com.rb +125 -0
- data/lib/whois/parsers/whois.za.net.rb +72 -0
- data/lib/whois/parsers/whois.za.org.rb +72 -0
- data/lib/whois/parsers/whois1.nic.bi.rb +25 -0
- data/lib/whois/parsers/za_central_registry.rb +68 -0
- data/lib/whois/parsers.rb +4 -0
- data/lib/whois/safe_record.rb +169 -0
- data/lib/whois/scanners/base.rb +116 -0
- data/lib/whois/scanners/base_afilias.rb +51 -0
- data/lib/whois/scanners/base_cocca2.rb +43 -0
- data/lib/whois/scanners/base_icann_compliant.rb +45 -0
- data/lib/whois/scanners/base_iisse.rb +36 -0
- data/lib/whois/scanners/base_shared1.rb +31 -0
- data/lib/whois/scanners/base_shared2.rb +35 -0
- data/lib/whois/scanners/base_shared3.rb +37 -0
- data/lib/whois/scanners/base_whoisd.rb +44 -0
- data/lib/whois/scanners/iana.rb +89 -0
- data/lib/whois/scanners/scannable.rb +65 -0
- data/lib/whois/scanners/verisign.rb +100 -0
- data/lib/whois/scanners/whois.ati.tn.rb +32 -0
- data/lib/whois/scanners/whois.audns.net.au.rb +25 -0
- data/lib/whois/scanners/whois.cctld.by.rb +35 -0
- data/lib/whois/scanners/whois.centralnic.com.rb +32 -0
- data/lib/whois/scanners/whois.cira.ca.rb +72 -0
- data/lib/whois/scanners/whois.cnnic.cn.rb +42 -0
- data/lib/whois/scanners/whois.denic.de.rb +96 -0
- data/lib/whois/scanners/whois.dns.hr.rb +25 -0
- data/lib/whois/scanners/whois.domainregistry.ie.rb +46 -0
- data/lib/whois/scanners/whois.fi.rb +39 -0
- data/lib/whois/scanners/whois.nc.rb +32 -0
- data/lib/whois/scanners/whois.nic.cz.rb +22 -0
- data/lib/whois/scanners/whois.nic.it.rb +92 -0
- data/lib/whois/scanners/whois.pir.org.rb +17 -0
- data/lib/whois/scanners/whois.registry.net.za.rb +92 -0
- data/lib/whois/scanners/whois.rnids.rs.rb +52 -0
- data/lib/whois/scanners/whois.smallregistry.net.rb +50 -0
- data/lib/whois/scanners/whois.srs.net.nz.rb +23 -0
- data/lib/whois/scanners/whois.sx.rb +37 -0
- data/lib/whois/scanners/whois.tld.ee.rb +47 -0
- data/lib/whois/scanners/whois.tucows.com.rb +23 -0
- data/lib/whois/scanners/whois.yoursrs.com.rb +24 -0
- data/lib/whois-parser.rb +10 -0
- data/whois-parser.gemspec +37 -19
- metadata +318 -20
- data/.gitignore +0 -14
- data/Gemfile +0 -4
- data/Rakefile +0 -2
@@ -0,0 +1,58 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
#
|
17
|
+
# = whois.eu.org parser
|
18
|
+
#
|
19
|
+
# Parser for the whois.eu.org server.
|
20
|
+
#
|
21
|
+
# NOTE: This parser is just a stub and provides only a few basic methods
|
22
|
+
# to check for domain availability and get domain status.
|
23
|
+
# Please consider to contribute implementing missing methods.
|
24
|
+
# See WhoisNicIt parser for an explanation of all available methods
|
25
|
+
# and examples.
|
26
|
+
#
|
27
|
+
class WhoisEuOrg < Base
|
28
|
+
|
29
|
+
property_supported :status do
|
30
|
+
if available?
|
31
|
+
:available
|
32
|
+
else
|
33
|
+
:registered
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
property_supported :available? do
|
38
|
+
!!(content_for_scanner =~ /Key not found/)
|
39
|
+
end
|
40
|
+
|
41
|
+
property_supported :registered? do
|
42
|
+
!available?
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
property_not_supported :created_on
|
47
|
+
|
48
|
+
property_not_supported :updated_on
|
49
|
+
|
50
|
+
property_not_supported :expires_on
|
51
|
+
|
52
|
+
|
53
|
+
property_not_supported :nameservers
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
# Parser for the whois.eu server.
|
17
|
+
#
|
18
|
+
class WhoisEu < Base
|
19
|
+
|
20
|
+
property_supported :domain do
|
21
|
+
if content_for_scanner =~ /Domain:\s+(.+)\n/
|
22
|
+
"#{$1.downcase}.eu"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
property_not_supported :domain_id
|
27
|
+
|
28
|
+
|
29
|
+
property_supported :status do
|
30
|
+
if available?
|
31
|
+
:available
|
32
|
+
else
|
33
|
+
:registered
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
property_supported :available? do
|
38
|
+
!!(content_for_scanner =~ /Status:\s+AVAILABLE/)
|
39
|
+
end
|
40
|
+
|
41
|
+
property_supported :registered? do
|
42
|
+
!available?
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
property_not_supported :created_on
|
47
|
+
|
48
|
+
property_not_supported :updated_on
|
49
|
+
|
50
|
+
property_not_supported :expires_on
|
51
|
+
|
52
|
+
|
53
|
+
property_supported :registrar do
|
54
|
+
if content_for_scanner =~ /Registrar:\s((.+\n)+)\n/
|
55
|
+
lines = $1
|
56
|
+
Parser::Registrar.new(
|
57
|
+
name: lines.slice(/Name:\s+(.+)/, 1),
|
58
|
+
url: lines.slice(/Website:\s+(.+)/, 1)
|
59
|
+
)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
property_not_supported :registrant_contacts
|
64
|
+
|
65
|
+
property_not_supported :admin_contacts
|
66
|
+
|
67
|
+
# Technical Contact
|
68
|
+
#
|
69
|
+
# Technical:
|
70
|
+
# Name: DNS Admin
|
71
|
+
# Organisation: Google Inc.
|
72
|
+
# Language: en
|
73
|
+
# Phone: +1.6506234000
|
74
|
+
# Fax: +1.6506188571
|
75
|
+
# Email: dns-admin@google.com
|
76
|
+
#
|
77
|
+
property_supported :technical_contacts do
|
78
|
+
if content_for_scanner =~ /Technical:\s((.+\n)+)\n/
|
79
|
+
lines = $1
|
80
|
+
Parser::Contact.new(
|
81
|
+
:type => Parser::Contact::TYPE_TECHNICAL,
|
82
|
+
:id => nil,
|
83
|
+
:name => lines.slice(/Name:\s*(.*)/, 1),
|
84
|
+
:organization => lines.slice(/Organisation:\s*(.*)/, 1),
|
85
|
+
:phone => lines.slice(/Phone:\s*(.*)/, 1),
|
86
|
+
:fax => lines.slice(/Fax:\s*(.*)/, 1),
|
87
|
+
:email => lines.slice(/Email:\s*(.*)/, 1)
|
88
|
+
)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
# Nameservers are listed in the following formats:
|
94
|
+
#
|
95
|
+
# Name servers:
|
96
|
+
# dns1.servicemagic.eu
|
97
|
+
# dns2.servicemagic.eu
|
98
|
+
#
|
99
|
+
# Name servers:
|
100
|
+
# dns1.servicemagic.eu (91.121.133.61)
|
101
|
+
# dns2.servicemagic.eu (91.121.103.77)
|
102
|
+
#
|
103
|
+
property_supported :nameservers do
|
104
|
+
if content_for_scanner =~ /Name\sservers:\s((.+\n)+)\n/
|
105
|
+
$1.split("\n").map do |line|
|
106
|
+
if line.strip =~ /(.+) \((.+)\)/
|
107
|
+
Parser::Nameserver.new(:name => $1, :ipv4 => $2)
|
108
|
+
else
|
109
|
+
Parser::Nameserver.new(:name => line.strip)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
# Checks whether the response has been throttled.
|
117
|
+
#
|
118
|
+
# @return [Boolean]
|
119
|
+
#
|
120
|
+
# @example
|
121
|
+
# -1: Still in grace period, wait 7777777 seconds
|
122
|
+
#
|
123
|
+
def response_throttled?
|
124
|
+
!!(content_for_scanner =~ /Still in grace period/)
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
require 'whois/scanners/whois.fi.rb'
|
12
|
+
|
13
|
+
|
14
|
+
module Whois
|
15
|
+
class Parsers
|
16
|
+
|
17
|
+
# Parser for the whois.fi server.
|
18
|
+
#
|
19
|
+
# @see Whois::Parsers::Example
|
20
|
+
# The Example parser for the list of all available methods.
|
21
|
+
#
|
22
|
+
class WhoisFi < Base
|
23
|
+
include Scanners::Scannable
|
24
|
+
|
25
|
+
self.scanner = Scanners::WhoisFi
|
26
|
+
|
27
|
+
|
28
|
+
property_supported :disclaimer do
|
29
|
+
node("field:disclaimer")
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
property_supported :domain do
|
34
|
+
node("domain")
|
35
|
+
end
|
36
|
+
|
37
|
+
property_not_supported :domain_id
|
38
|
+
|
39
|
+
|
40
|
+
property_supported :status do
|
41
|
+
if reserved?
|
42
|
+
:reserved
|
43
|
+
elsif registered?
|
44
|
+
case node("status", &:downcase)
|
45
|
+
when "granted"
|
46
|
+
:registered
|
47
|
+
when "grace period"
|
48
|
+
:registered
|
49
|
+
else
|
50
|
+
Whois.bug!(ParserError, "Unknown status `#{node("status")}'.")
|
51
|
+
end
|
52
|
+
else
|
53
|
+
:available
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
property_supported :available? do
|
58
|
+
!!node("status:available")
|
59
|
+
end
|
60
|
+
|
61
|
+
property_supported :registered? do
|
62
|
+
!available?
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
property_supported :created_on do
|
67
|
+
node("created") { |value| parse_time(value) }
|
68
|
+
end
|
69
|
+
|
70
|
+
property_supported :updated_on do
|
71
|
+
node("modified") { |value| parse_time(value) }
|
72
|
+
end
|
73
|
+
|
74
|
+
property_supported :expires_on do
|
75
|
+
node("expires") { |value| parse_time(value) }
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
property_not_supported :registrar
|
80
|
+
|
81
|
+
property_supported :registrant_contacts do
|
82
|
+
node("descr") do |array|
|
83
|
+
address = node("address")
|
84
|
+
|
85
|
+
Parser::Contact.new(
|
86
|
+
type: Parser::Contact::TYPE_REGISTRANT,
|
87
|
+
id: array[1],
|
88
|
+
name: address[0],
|
89
|
+
organization: array[0],
|
90
|
+
address: address[1],
|
91
|
+
zip: address[2],
|
92
|
+
city: address[3],
|
93
|
+
phone: node("phone")
|
94
|
+
)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
property_not_supported :admin_contacts
|
99
|
+
|
100
|
+
property_not_supported :technical_contacts
|
101
|
+
|
102
|
+
|
103
|
+
property_supported :nameservers do
|
104
|
+
Array.wrap(node("nserver")).map do |line|
|
105
|
+
Parser::Nameserver.new(name: line.split(" ").first)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# NEWPROPERTY
|
110
|
+
def reserved?
|
111
|
+
!!content_for_scanner.match(/Domain not available/)
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base_icann_compliant'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
# Parser for the whois.gandi.net server.
|
17
|
+
#
|
18
|
+
# @see Whois::Parsers::Example
|
19
|
+
# The Example parser for the list of all available methods.
|
20
|
+
#
|
21
|
+
class WhoisGandiNet < BaseIcannCompliant
|
22
|
+
|
23
|
+
property_supported :available? do
|
24
|
+
content_for_scanner == "\n"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base_cocca2'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
# Parser for the whois.gg server.
|
17
|
+
#
|
18
|
+
# @see Whois::Parsers::Example
|
19
|
+
# The Example parser for the list of all available methods.
|
20
|
+
#
|
21
|
+
class WhoisGg < BaseCocca2
|
22
|
+
|
23
|
+
property_supported :status do
|
24
|
+
list = Array.wrap(node("Domain Status")).map(&:downcase)
|
25
|
+
list.include?("available") ? :available : super()
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
# Parser for the whois.godaddy.com server.
|
17
|
+
#
|
18
|
+
# @see Whois::Parsers::Example
|
19
|
+
# The Example parser for the list of all available methods.
|
20
|
+
#
|
21
|
+
class WhoisGodaddyCom < Base
|
22
|
+
|
23
|
+
property_not_supported :status
|
24
|
+
|
25
|
+
# The server is contacted only in case of a registered domain.
|
26
|
+
property_supported :available? do
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
30
|
+
property_supported :registered? do
|
31
|
+
!available?
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
property_supported :created_on do
|
36
|
+
if content_for_scanner =~ /Creation Date: (.+)\n/
|
37
|
+
parse_time($1)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
property_supported :updated_on do
|
42
|
+
if content_for_scanner =~ /Updated* Date: (.+)\n/
|
43
|
+
parse_time($1)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
property_supported :expires_on do
|
48
|
+
if content_for_scanner =~ /Expiration Date: (.+)\n/
|
49
|
+
parse_time($1)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
property_supported :registrar do
|
55
|
+
Parser::Registrar.new(
|
56
|
+
name: content_for_scanner[/Registrar: (.+)\n/, 1],
|
57
|
+
url: content_for_scanner[/Registrar URL: (.+)\n/, 1],
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
property_supported :registrant_contacts do
|
62
|
+
build_contact('Registrant', Parser::Contact::TYPE_REGISTRANT)
|
63
|
+
end
|
64
|
+
|
65
|
+
property_supported :admin_contacts do
|
66
|
+
build_contact('Admin', Parser::Contact::TYPE_ADMINISTRATIVE)
|
67
|
+
end
|
68
|
+
|
69
|
+
property_supported :technical_contacts do
|
70
|
+
build_contact('Tech', Parser::Contact::TYPE_TECHNICAL)
|
71
|
+
end
|
72
|
+
|
73
|
+
property_supported :nameservers do
|
74
|
+
content_for_scanner.scan(/Name Server: (.+)\n/).map do |line|
|
75
|
+
Parser::Nameserver.new(name: line[0].strip)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def build_contact(element, type)
|
83
|
+
Parser::Contact.new(
|
84
|
+
type: type,
|
85
|
+
id: nil,
|
86
|
+
name: value_for_property(element, 'Name'),
|
87
|
+
organization: value_for_property(element, 'Organization'),
|
88
|
+
address: value_for_property(element, 'Street'),
|
89
|
+
city: value_for_property(element, 'City'),
|
90
|
+
zip: value_for_property(element, 'Postal Code'),
|
91
|
+
state: value_for_property(element, 'State/Province'),
|
92
|
+
country: value_for_property(element, 'Country'),
|
93
|
+
phone: value_for_property(element, 'Phone'),
|
94
|
+
fax: value_for_property(element, 'Fax'),
|
95
|
+
email: value_for_property(element, 'Email')
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
def value_for_property(element, property)
|
100
|
+
matches = content_for_scanner.scan(/#{element} #{property}:\s(.+)\n/)
|
101
|
+
value = matches.collect(&:first).join(', ')
|
102
|
+
if value == ""
|
103
|
+
nil
|
104
|
+
else
|
105
|
+
value
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
# Parser for the whois.gov.za server.
|
17
|
+
#
|
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.
|
24
|
+
#
|
25
|
+
class WhoisGovZa < Base
|
26
|
+
|
27
|
+
property_supported :status do
|
28
|
+
if available?
|
29
|
+
:available
|
30
|
+
else
|
31
|
+
:registered
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
property_supported :available? do
|
36
|
+
!!(content_for_scanner =~ /^No match found for/)
|
37
|
+
end
|
38
|
+
|
39
|
+
property_supported :registered? do
|
40
|
+
!available?
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
property_supported :created_on do
|
45
|
+
if content_for_scanner =~ /Date : (.+)\n/
|
46
|
+
parse_time($1)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
property_not_supported :updated_on
|
51
|
+
|
52
|
+
property_not_supported :expires_on
|
53
|
+
|
54
|
+
|
55
|
+
property_not_supported :nameservers
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Parsers
|
15
|
+
|
16
|
+
# Parser for the whois.hkirc.hk server.
|
17
|
+
#
|
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.
|
24
|
+
#
|
25
|
+
class WhoisHkircHk < Base
|
26
|
+
|
27
|
+
property_supported :status do
|
28
|
+
if available?
|
29
|
+
:available
|
30
|
+
else
|
31
|
+
:registered
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
property_supported :available? do
|
36
|
+
content_for_scanner.strip == 'The domain has not been registered.'
|
37
|
+
end
|
38
|
+
|
39
|
+
property_supported :registered? do
|
40
|
+
!available?
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
property_supported :created_on do
|
45
|
+
if content_for_scanner =~ /Domain Name Commencement Date:\s(.+?)\n/
|
46
|
+
parse_time($1)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
property_not_supported :updated_on
|
51
|
+
|
52
|
+
property_supported :expires_on do
|
53
|
+
if content_for_scanner =~ /Expiry Date:\s(.+?)\n/
|
54
|
+
parse_time($1.strip)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
property_supported :nameservers do
|
60
|
+
if content_for_scanner =~ /Name Servers Information:\n\n((.+\n)+)\n/
|
61
|
+
$1.split("\n").map do |name|
|
62
|
+
Parser::Nameserver.new(:name => name.strip.downcase)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require_relative 'base'
|
11
|
+
require 'whois/scanners/iana'
|
12
|
+
|
13
|
+
|
14
|
+
module Whois
|
15
|
+
class Parsers
|
16
|
+
|
17
|
+
# Parser for the whois.iana.org server.
|
18
|
+
class WhoisIanaOrg < Base
|
19
|
+
include Scanners::Scannable
|
20
|
+
|
21
|
+
self.scanner = Scanners::Iana
|
22
|
+
|
23
|
+
|
24
|
+
property_supported :status do
|
25
|
+
if available?
|
26
|
+
:available
|
27
|
+
else
|
28
|
+
:registered
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
property_supported :available? do
|
33
|
+
!!(content_for_scanner =~ /This query returned 0 objects|organisation: Not assigned/)
|
34
|
+
end
|
35
|
+
|
36
|
+
property_supported :registered? do
|
37
|
+
!available?
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
# TODO: registrar
|
42
|
+
|
43
|
+
property_supported :registrant_contacts do
|
44
|
+
build_contact("organisation", Parser::Contact::TYPE_REGISTRANT)
|
45
|
+
end
|
46
|
+
|
47
|
+
property_supported :admin_contacts do
|
48
|
+
build_contact("administrative", Parser::Contact::TYPE_ADMINISTRATIVE)
|
49
|
+
end
|
50
|
+
|
51
|
+
property_supported :technical_contacts do
|
52
|
+
build_contact("technical", Parser::Contact::TYPE_TECHNICAL)
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
property_supported :created_on do
|
57
|
+
node("dates") { |raw| parse_time(raw["created"]) }
|
58
|
+
end
|
59
|
+
|
60
|
+
property_supported :updated_on do
|
61
|
+
node("dates") { |raw| parse_time(raw["changed"]) }
|
62
|
+
end
|
63
|
+
|
64
|
+
property_not_supported :expires_on
|
65
|
+
|
66
|
+
|
67
|
+
property_supported :nameservers do
|
68
|
+
node("nameservers") do |raw|
|
69
|
+
(raw["nserver"] || "").split("\n").map do |line|
|
70
|
+
name, ipv4 = line.downcase.split(/\s+/)
|
71
|
+
Parser::Nameserver.new(:name => name, :ipv4 => ipv4)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def build_contact(element, type)
|
80
|
+
node(element) do |raw|
|
81
|
+
if raw["organisation"] != "Not assigned"
|
82
|
+
address = (raw["address"] || "").split("\n")
|
83
|
+
Parser::Contact.new(
|
84
|
+
:type => type,
|
85
|
+
:name => raw["name"],
|
86
|
+
:organization => raw["organisation"],
|
87
|
+
:address => address[0],
|
88
|
+
:city => address[1],
|
89
|
+
:zip => address[2],
|
90
|
+
:country => address[3],
|
91
|
+
:phone => raw["phone"],
|
92
|
+
:fax => raw["fax-no"],
|
93
|
+
:email => raw["e-mail"]
|
94
|
+
)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|