whois 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +11 -0
- data/lib/whois/definitions/tlds.rb +1 -0
- data/lib/whois/record/parser/whois.ati.tn.rb +1 -1
- data/lib/whois/record/parser/whois.godaddy.com.rb +0 -4
- data/lib/whois/record/parser/whois.markmonitor.com.rb +0 -4
- data/lib/whois/record/parser/whois.networksolutions.com.rb +146 -0
- data/lib/whois/record/parser/whois.registry.om.rb +1 -1
- data/lib/whois/record/parser/whois.sx.rb +124 -0
- data/lib/whois/record/parser/whois.ua.rb +70 -10
- data/lib/whois/record/scanners/base.rb +19 -6
- data/lib/whois/record/scanners/whois.ati.tn.rb +1 -1
- data/lib/whois/record/scanners/whois.registry.om.rb +1 -1
- data/lib/whois/record/scanners/whois.rnids.rs.rb +11 -11
- data/lib/whois/record/scanners/whois.sx.rb +81 -0
- data/lib/whois/version.rb +1 -1
- data/spec/fixtures/responses/whois.networksolutions.com/property_contacts_short.expected +47 -0
- data/spec/fixtures/responses/whois.networksolutions.com/property_contacts_short.txt +61 -0
- data/spec/fixtures/responses/whois.networksolutions.com/status_registered.expected +89 -0
- data/spec/fixtures/responses/whois.networksolutions.com/status_registered.txt +65 -0
- data/spec/fixtures/responses/whois.sx/status_available.expected +55 -0
- data/spec/fixtures/responses/whois.sx/status_available.txt +9 -0
- data/spec/fixtures/responses/whois.sx/status_registered.expected +85 -0
- data/spec/fixtures/responses/whois.sx/status_registered.txt +21 -0
- data/spec/fixtures/responses/whois.ua/property_contacts_multiple.expected +107 -0
- data/spec/fixtures/responses/whois.ua/property_contacts_multiple.txt +84 -0
- data/spec/fixtures/responses/whois.ua/status_available.expected +30 -1
- data/spec/fixtures/responses/whois.ua/status_registered.expected +65 -3
- data/spec/fixtures/responses/whois.ua/status_registered.txt +10 -9
- data/spec/tlds +1 -0
- data/spec/whois/record/parser/responses/whois.net.ua/property_contacts_multiple_spec.rb +157 -0
- data/spec/whois/record/parser/responses/whois.net.ua/property_nameservers_uppercase_spec.rb +4 -4
- data/spec/whois/record/parser/responses/whois.net.ua/status_available_spec.rb +47 -5
- data/spec/whois/record/parser/responses/whois.net.ua/status_registered_spec.rb +82 -7
- data/spec/whois/record/parser/responses/whois.networksolutions.com/property_contacts_short_spec.rb +77 -0
- data/spec/whois/record/parser/responses/whois.networksolutions.com/status_registered_spec.rb +133 -0
- data/spec/whois/record/parser/responses/whois.sx/status_available_spec.rb +106 -0
- data/spec/whois/record/parser/responses/whois.sx/status_registered_spec.rb +136 -0
- data/spec/whois/record/parser/responses/whois.ua/property_contacts_multiple_spec.rb +157 -0
- data/spec/whois/record/parser/responses/whois.ua/status_available_spec.rb +43 -1
- data/spec/whois/record/parser/responses/whois.ua/status_registered_spec.rb +78 -3
- data/whois.gemspec +4 -4
- metadata +22 -3
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
|
4
|
+
## Release 2.6.2
|
5
|
+
|
6
|
+
* SERVER: Added .SX TLD server (GH-170).
|
7
|
+
|
8
|
+
* NEW: Added full whois.networksolutions.com parser (GH-168). [Thanks @bramp]
|
9
|
+
|
10
|
+
* NEW: Added full whois.sx parser (GH-170).
|
11
|
+
|
12
|
+
* NEW: whois.ua parser is now a full parser (GH-169). [Thanks @Uko]
|
13
|
+
|
14
|
+
|
4
15
|
## Release 2.6.1
|
5
16
|
|
6
17
|
* Reverted partial commit about .SX definitions included in v2.6.0 by mistake.
|
@@ -273,6 +273,7 @@ Whois::Server.define :tld, ".sr", nil, { :adapter => Whois::Server::Adapters::No
|
|
273
273
|
Whois::Server.define :tld, ".st", "whois.nic.st"
|
274
274
|
Whois::Server.define :tld, ".su", "whois.tcinet.ru"
|
275
275
|
Whois::Server.define :tld, ".sv", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.uca.edu.sv/dns/" }
|
276
|
+
Whois::Server.define :tld, ".sx", "whois.sx"
|
276
277
|
Whois::Server.define :tld, ".sy", nil, { :adapter => Whois::Server::Adapters::None }
|
277
278
|
Whois::Server.define :tld, ".sz", nil, { :adapter => Whois::Server::Adapters::None }
|
278
279
|
Whois::Server.define :tld, ".tc", "whois.adamsnames.tc"
|
@@ -15,10 +15,6 @@ module Whois
|
|
15
15
|
class Parser
|
16
16
|
|
17
17
|
# Parser for the whois.godaddy.com server.
|
18
|
-
#
|
19
|
-
# @note This parser is just a stub and provides only a few basic methods
|
20
|
-
# to check for domain availability and get domain status.
|
21
|
-
# Please consider to contribute implementing missing methods.
|
22
18
|
#
|
23
19
|
# @see Whois::Record::Parser::Example
|
24
20
|
# The Example parser for the list of all available methods.
|
@@ -16,10 +16,6 @@ module Whois
|
|
16
16
|
|
17
17
|
# Parser for the whois.markmonitor.com server.
|
18
18
|
#
|
19
|
-
# @note This parser is just a stub and provides only a few basic methods
|
20
|
-
# to check for domain availability and get domain status.
|
21
|
-
# Please consider to contribute implementing missing methods.
|
22
|
-
#
|
23
19
|
# @see Whois::Record::Parser::Example
|
24
20
|
# The Example parser for the list of all available methods.
|
25
21
|
class WhoisMarkmonitorCom < Base
|
@@ -0,0 +1,146 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require 'whois/record/parser/base'
|
11
|
+
|
12
|
+
|
13
|
+
module Whois
|
14
|
+
class Record
|
15
|
+
class Parser
|
16
|
+
|
17
|
+
# Parser for the whois.networksolutions.com server.
|
18
|
+
#
|
19
|
+
# @see Whois::Record::Parser::Example
|
20
|
+
# The Example parser for the list of all available methods.
|
21
|
+
#
|
22
|
+
# @author Andrew Brampton <me@bramp.net>
|
23
|
+
# @since RELEASE
|
24
|
+
class WhoisNetworksolutionsCom < Base
|
25
|
+
|
26
|
+
property_not_supported :status
|
27
|
+
|
28
|
+
# The server is contacted only in case of a registered domain.
|
29
|
+
property_supported :available? do
|
30
|
+
false
|
31
|
+
end
|
32
|
+
|
33
|
+
property_supported :registered? do
|
34
|
+
!available?
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
property_supported :created_on do
|
39
|
+
if content_for_scanner =~ /Record created on (.+)\.\n/
|
40
|
+
Time.parse($1)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
property_not_supported :updated_on
|
45
|
+
|
46
|
+
property_supported :expires_on do
|
47
|
+
if content_for_scanner =~ /Record expires on (.+)\.\n/
|
48
|
+
Time.parse($1)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
property_supported :registrar do
|
54
|
+
Record::Registrar.new(
|
55
|
+
:name => 'Network Solutions',
|
56
|
+
:organization => 'Network Solutions, LLC',
|
57
|
+
:url => 'http://www.networksolutions.com/'
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
property_supported :registrant_contacts do
|
62
|
+
build_contact('Registrant:', Record::Contact::TYPE_REGISTRANT)
|
63
|
+
end
|
64
|
+
|
65
|
+
property_supported :admin_contacts do
|
66
|
+
build_contact('Administrative Contact', Record::Contact::TYPE_ADMIN)
|
67
|
+
end
|
68
|
+
|
69
|
+
property_supported :technical_contacts do
|
70
|
+
build_contact('Technical Contact', Record::Contact::TYPE_TECHNICAL)
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
property_supported :nameservers do
|
75
|
+
if content_for_scanner =~ /Domain servers in listed order:\n\n((?:[^\n]+\n)+)/
|
76
|
+
$1.split("\n").map do |line|
|
77
|
+
# NS01.XIF.COM 63.240.200.70
|
78
|
+
name, ipv4 = line.strip.split(" ")
|
79
|
+
Record::Nameserver.new(:name => name.downcase, :ipv4 => ipv4)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
def build_contact(element, type)
|
88
|
+
match = content_for_scanner.slice(/#{element}.*\n((.+\n){4,7})/, 1)
|
89
|
+
return unless match
|
90
|
+
|
91
|
+
lines = match.split("\n").map(&:strip)
|
92
|
+
|
93
|
+
# 0 XIF Communications | mpowers LLC
|
94
|
+
# 1 1200 New Hampshire Avenue NW | 21010 Southbank St #575
|
95
|
+
# 2 Suite 410 | Potomac Falls, VA 20165
|
96
|
+
# 3 Washington, DC 20036 | US
|
97
|
+
# 4 US
|
98
|
+
|
99
|
+
# 0 Communications, XIF ContactMiddleName noc@xif.com | mpowers LLC michael@mpowers.net
|
100
|
+
# 1 XIF Communications | 21010 Southbank St #575
|
101
|
+
# 2 1200 New Hampshire Avenue NW | Potomac Falls, VA 20165
|
102
|
+
# 3 Suite 410 | US
|
103
|
+
# 4 Washington, DC 20036 | +1.5712832829
|
104
|
+
# 5 US
|
105
|
+
# 6 202-463-7200 fax: 202-318-4003
|
106
|
+
|
107
|
+
# Does the first line end in something that looks like a email address?
|
108
|
+
if lines[0].to_s =~ /\S+@\S+$/
|
109
|
+
# The record has a extra name and number line
|
110
|
+
name, email = lines.shift.scan(/^(.+)\s(\S+@\S+)$/).first
|
111
|
+
name = name.strip
|
112
|
+
end
|
113
|
+
|
114
|
+
# Does the last line contains the word fax, or has >9 digits
|
115
|
+
if lines[-1].to_s =~ / fax: /
|
116
|
+
phone, fax = lines.pop.to_s.scan(/^(.+) fax: (.+)$/).first
|
117
|
+
phone = phone.strip
|
118
|
+
fax = fax.strip
|
119
|
+
elsif lines[-1].to_s.gsub(/[^\d]+/, '').length > 9
|
120
|
+
phone = lines.pop
|
121
|
+
end
|
122
|
+
|
123
|
+
country_code = lines.pop
|
124
|
+
city, state, zip = lines.pop.scan(/^(.+), ([A-Z]{2}) ([\sA-Z0-9\-]+)$/).first
|
125
|
+
organization = lines.shift if lines.length >= 2
|
126
|
+
|
127
|
+
address = lines.join("\n")
|
128
|
+
|
129
|
+
Record::Contact.new(
|
130
|
+
:type => type,
|
131
|
+
:name => name,
|
132
|
+
:organization => organization,
|
133
|
+
:address => address,
|
134
|
+
:city => city,
|
135
|
+
:state => state,
|
136
|
+
:zip => zip,
|
137
|
+
:country_code => country_code,
|
138
|
+
:email => email,
|
139
|
+
:phone => phone,
|
140
|
+
:fax => fax
|
141
|
+
)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
#--
|
2
|
+
# Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
|
7
|
+
#++
|
8
|
+
|
9
|
+
|
10
|
+
require 'whois/record/parser/base'
|
11
|
+
require 'whois/record/scanners/whois.sx.rb'
|
12
|
+
|
13
|
+
|
14
|
+
module Whois
|
15
|
+
class Record
|
16
|
+
class Parser
|
17
|
+
|
18
|
+
# Parser for the whois.sx server.
|
19
|
+
#
|
20
|
+
# @see Whois::Record::Parser::Example
|
21
|
+
# The Example parser for the list of all available methods.
|
22
|
+
#
|
23
|
+
# @since RELEASE
|
24
|
+
class WhoisSx < Base
|
25
|
+
include Scanners::Ast
|
26
|
+
|
27
|
+
property_not_supported :disclaimer
|
28
|
+
|
29
|
+
|
30
|
+
property_supported :domain do
|
31
|
+
"#{node('Domain')}.sx"
|
32
|
+
end
|
33
|
+
|
34
|
+
property_not_supported :domain_id
|
35
|
+
|
36
|
+
|
37
|
+
property_not_supported :referral_whois
|
38
|
+
|
39
|
+
property_not_supported :referral_url
|
40
|
+
|
41
|
+
|
42
|
+
property_supported :status do
|
43
|
+
case (s = node('Status'))
|
44
|
+
when /free/
|
45
|
+
:available
|
46
|
+
when 'active'
|
47
|
+
:registered
|
48
|
+
else
|
49
|
+
Whois.bug!(ParserError, "Unknown status `#{s}'.")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
property_supported :available? do
|
54
|
+
status == :available
|
55
|
+
end
|
56
|
+
|
57
|
+
property_supported :registered? do
|
58
|
+
!available?
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
property_not_supported :created_on
|
63
|
+
|
64
|
+
property_not_supported :updated_on
|
65
|
+
|
66
|
+
property_not_supported :expires_on
|
67
|
+
|
68
|
+
|
69
|
+
property_supported :registrar do
|
70
|
+
node('Registrar') do |hash|
|
71
|
+
Record::Registrar.new(
|
72
|
+
:name => hash['Name'],
|
73
|
+
:url => hash['Website']
|
74
|
+
)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
property_supported :registrant_contacts do
|
80
|
+
build_contact('Registrant', Whois::Record::Contact::TYPE_REGISTRANT)
|
81
|
+
end
|
82
|
+
|
83
|
+
property_not_supported :admin_contacts
|
84
|
+
|
85
|
+
property_not_supported :technical_contacts
|
86
|
+
|
87
|
+
|
88
|
+
property_supported :nameservers do
|
89
|
+
node('Name servers') do |names|
|
90
|
+
names.map do |name|
|
91
|
+
Record::Nameserver.new(:name => name)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
# Initializes a new {Scanners::WhoisSx} instance
|
98
|
+
# passing the {#content_for_scanner}
|
99
|
+
# and calls +parse+ on it.
|
100
|
+
#
|
101
|
+
# @return [Hash]
|
102
|
+
def parse
|
103
|
+
Scanners::WhoisSx.new(content_for_scanner).parse
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def build_contact(element, type)
|
110
|
+
node("#{element}") do |array|
|
111
|
+
Record::Contact.new(
|
112
|
+
:type => type,
|
113
|
+
:id => nil,
|
114
|
+
:name => array[0],
|
115
|
+
:email => nil
|
116
|
+
)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
@@ -16,20 +16,30 @@ module Whois
|
|
16
16
|
|
17
17
|
# Parser for the whois.ua server.
|
18
18
|
#
|
19
|
-
# @note This parser is just a stub and provides only a few basic methods
|
20
|
-
# to check for domain availability and get domain status.
|
21
|
-
# Please consider to contribute implementing missing methods.
|
22
|
-
#
|
23
19
|
# @since 2.4.0
|
24
20
|
class WhoisUa < Base
|
25
21
|
|
22
|
+
property_supported :domain do
|
23
|
+
if content_for_scanner =~ /domain:\s+(.+)\n/
|
24
|
+
$1
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
property_not_supported :domain_id
|
29
|
+
|
30
|
+
|
31
|
+
property_not_supported :referral_whois
|
32
|
+
|
33
|
+
property_not_supported :referral_url
|
34
|
+
|
35
|
+
|
26
36
|
property_supported :status do
|
27
37
|
if content_for_scanner =~ /status:\s+(.+?)\n/
|
28
|
-
case s = $1.downcase
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
38
|
+
case (s = $1.downcase)
|
39
|
+
when /^ok-until/
|
40
|
+
:registered
|
41
|
+
else
|
42
|
+
Whois.bug!(ParserError, "Unknown status `#{s}'.")
|
33
43
|
end
|
34
44
|
else
|
35
45
|
:available
|
@@ -45,7 +55,12 @@ module Whois
|
|
45
55
|
end
|
46
56
|
|
47
57
|
|
48
|
-
|
58
|
+
property_supported :created_on do
|
59
|
+
if content_for_scanner =~ /created:\s+(.+)\n/
|
60
|
+
time = $1.split(" ").last
|
61
|
+
Time.parse(time)
|
62
|
+
end
|
63
|
+
end
|
49
64
|
|
50
65
|
property_supported :updated_on do
|
51
66
|
if content_for_scanner =~ /changed:\s+(.+)\n/
|
@@ -62,12 +77,57 @@ module Whois
|
|
62
77
|
end
|
63
78
|
|
64
79
|
|
80
|
+
property_not_supported :registrar
|
81
|
+
|
82
|
+
property_not_supported :registrant_contacts
|
83
|
+
|
84
|
+
property_supported :admin_contacts do
|
85
|
+
build_contact("Administrative", Whois::Record::Contact::TYPE_ADMIN)
|
86
|
+
end
|
87
|
+
|
88
|
+
property_supported :technical_contacts do
|
89
|
+
build_contact("Technical", Whois::Record::Contact::TYPE_TECHNICAL)
|
90
|
+
end
|
91
|
+
|
92
|
+
|
65
93
|
property_supported :nameservers do
|
66
94
|
content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |name|
|
67
95
|
Record::Nameserver.new(:name => name.strip.downcase)
|
68
96
|
end
|
69
97
|
end
|
70
98
|
|
99
|
+
|
100
|
+
private
|
101
|
+
|
102
|
+
def build_contact(element, type)
|
103
|
+
record = []
|
104
|
+
content_for_scanner.scan(/%\s#{element}\sContact:\n %\s=+\n ((?: .+\n)+) (?: \n|\z)/ix).flatten.each do |match|
|
105
|
+
address = match.scan(/address:\s+(.+)\n/).flatten
|
106
|
+
zip = nil
|
107
|
+
zip = address[1].slice!(/\s+\d{5}/).strip if address[1] =~ /\s+\d{5}/
|
108
|
+
zip = address[1].slice!(/\d{5}\s+/).strip if address[1] =~ /\d{5}\s+/
|
109
|
+
state = nil
|
110
|
+
state = address[1].slice!(/\s+[A-Z]{2}\z/).strip if address[1] =~ /\s+[A-Z]{2}\z/
|
111
|
+
|
112
|
+
record.push Record::Contact.new(
|
113
|
+
:type => type,
|
114
|
+
:id => match[/org-id:\s+(.+)\n/,1],
|
115
|
+
:name => nil,
|
116
|
+
:organization => match.scan(/organization:\s+(.+)\n/).join("\n"),
|
117
|
+
:address => address[0],
|
118
|
+
:zip => zip,
|
119
|
+
:state => state,
|
120
|
+
:city => address[1],
|
121
|
+
:country => address[2],
|
122
|
+
:phone => match[/phone:\s+(.+)\n/,1],
|
123
|
+
:fax => match[/fax-no:\s+(.+)\n/,1],
|
124
|
+
:email => match[/e-mail:\s+(.+)\n/,1],
|
125
|
+
:updated_on => (Time.parse($1.split(" ").last) if match =~ /changed:\s+(.+)\n/)
|
126
|
+
)
|
127
|
+
end
|
128
|
+
record
|
129
|
+
end
|
130
|
+
|
71
131
|
end
|
72
132
|
|
73
133
|
end
|