whois 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/lib/whois/record/parser/whois.dns.be.rb +15 -17
  2. data/lib/whois/record/parser/whois.domainregistry.ie.rb +7 -3
  3. data/lib/whois/record/parser/whois.enom.com.rb +1 -1
  4. data/lib/whois/record/parser/whois.nic.uk.rb +15 -13
  5. data/lib/whois/record/scanners/whois.cnnic.cn.rb +7 -0
  6. data/lib/whois/record/scanners/whois.domainregistry.ie.rb +8 -0
  7. data/lib/whois/version.rb +1 -1
  8. data/spec/fixtures/responses/whois.cnnic.cn/status_reserved_list.expected +12 -0
  9. data/spec/fixtures/responses/whois.cnnic.cn/status_reserved_list.txt +1 -0
  10. data/spec/fixtures/responses/whois.dns.be/property_status_available.expected +8 -0
  11. data/spec/fixtures/responses/whois.dns.be/property_status_available.txt +39 -0
  12. data/spec/fixtures/responses/whois.dns.be/property_status_free.expected +8 -0
  13. data/spec/fixtures/responses/whois.dns.be/property_status_free.txt +41 -0
  14. data/spec/fixtures/responses/whois.dns.be/property_status_not_available.expected +8 -0
  15. data/spec/fixtures/responses/whois.dns.be/property_status_not_available.txt +63 -0
  16. data/spec/fixtures/responses/whois.dns.be/property_status_registered.expected +8 -0
  17. data/spec/fixtures/responses/whois.dns.be/property_status_registered.txt +66 -0
  18. data/spec/fixtures/responses/whois.dns.be/status_available.txt +39 -41
  19. data/spec/fixtures/responses/whois.dns.be/status_registered.txt +65 -66
  20. data/spec/fixtures/responses/whois.domainregistry.ie/property_contacts_multiple.expected +19 -0
  21. data/spec/fixtures/responses/whois.domainregistry.ie/property_contacts_multiple.txt +29 -0
  22. data/spec/fixtures/responses/whois.domainregistry.ie/token_application_pending.expected +2 -0
  23. data/spec/fixtures/responses/whois.domainregistry.ie/token_application_pending.txt +10 -0
  24. data/spec/fixtures/responses/whois.enom.com/property_contacts_empty_name.expected +15 -0
  25. data/spec/fixtures/responses/whois.enom.com/property_contacts_empty_name.txt +65 -0
  26. data/spec/fixtures/responses/whois.nic.uk/property_status_registered_until_expiry_date.expected +8 -0
  27. data/spec/fixtures/responses/whois.nic.uk/property_status_registered_until_expiry_date.txt +45 -0
  28. data/spec/whois/record/parser/responses/whois.cnnic.cn/status_reserved_list_spec.rb +44 -0
  29. data/spec/whois/record/parser/responses/whois.dns.be/property_status_available_spec.rb +39 -0
  30. data/spec/whois/record/parser/responses/whois.dns.be/property_status_free_spec.rb +39 -0
  31. data/spec/whois/record/parser/responses/whois.dns.be/property_status_not_available_spec.rb +39 -0
  32. data/spec/whois/record/parser/responses/whois.dns.be/property_status_registered_spec.rb +39 -0
  33. data/spec/whois/record/parser/responses/whois.domainregistry.ie/property_contacts_multiple_spec.rb +48 -0
  34. data/spec/whois/record/parser/responses/whois.domainregistry.ie/token_application_pending_spec.rb +29 -0
  35. data/spec/whois/record/parser/responses/whois.enom.com/property_contacts_empty_name_spec.rb +42 -0
  36. data/spec/whois/record/parser/responses/whois.nic.uk/property_status_registered_until_expiry_date_spec.rb +39 -0
  37. data/whois.gemspec +4 -4
  38. metadata +30 -3
@@ -14,31 +14,29 @@ module Whois
14
14
  class Record
15
15
  class Parser
16
16
 
17
- #
18
- # = whois.dns.be parser
19
- #
20
17
  # Parser for the whois.dns.be server.
21
18
  #
22
- # NOTE: This parser is just a stub and provides only a few basic methods
23
- # to check for domain availability and get domain status.
24
- # Please consider to contribute implementing missing methods.
25
- # See WhoisNicIt parser for an explanation of all available methods
26
- # and examples.
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
+ # @see Whois::Record::Parser::Example
24
+ # The Example parser for the list of all available methods.
27
25
  #
28
26
  class WhoisDnsBe < Base
29
27
 
30
28
  property_supported :status do
31
29
  if content_for_scanner =~ /Status:\s+(.+?)\n/
32
30
  case $1.downcase
33
- when "registered" then :registered
34
- when "quarantine" then :redemption
35
- #when "blocked" then :registered
36
- when "out of service" then :redemption
37
- #when "withdrawn" then :registered
38
- #when "reserved" then :registered
39
- when "free" then :available
40
- else
41
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
31
+ when "available" then :available
32
+ when "not available" then :registered
33
+ when "quarantine" then :redemption
34
+ when "out of service" then :redemption
35
+ # old response
36
+ when "registered" then :registered
37
+ when "free" then :available
38
+ else
39
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
42
40
  end
43
41
  else
44
42
  Whois.bug!(ParserError, "Unable to parse status.")
@@ -42,10 +42,14 @@ module Whois
42
42
 
43
43
  property_supported :status do
44
44
  case node("status", &:downcase)
45
- when nil
46
- :available
47
45
  when "active"
48
46
  :registered
47
+ when nil
48
+ if node("status:pending")
49
+ :registered
50
+ else
51
+ :available
52
+ end
49
53
  else
50
54
  Whois.bug!(ParserError, "Unknown status `#{node("status")}'.")
51
55
  end
@@ -112,7 +116,7 @@ module Whois
112
116
  private
113
117
 
114
118
  def build_contact(element, type)
115
- node(element) do |id|
119
+ Array.wrap(node(element)).map do |id|
116
120
  contact = node("field:#{id}")
117
121
  Record::Contact.new(
118
122
  :type => type,
@@ -97,7 +97,7 @@ module Whois
97
97
  # 6 US
98
98
 
99
99
  lines = match.split("\n").map(&:lstrip)
100
- name, email = lines[1].match(/(.+) \((.*)\)/)[1..2].map(&:strip)
100
+ name, email = lines[1].match(/(.*)\((.*)\)/)[1..2].map(&:strip)
101
101
  fax = lines[3].match(/Fax: (.*)/)[1]
102
102
  city, state, zip = lines[-2].match(/(.*),(.+?)(\d*)$/)[1..3].map(&:strip)
103
103
 
@@ -37,19 +37,21 @@ module Whois
37
37
  property_supported :status do
38
38
  if content_for_scanner =~ /\s+Registration status:\s+(.+?)\n/
39
39
  case $1.downcase
40
- when "registered until renewal date."
41
- :registered
42
- when "registration request being processed."
43
- :registered
44
- when "renewal request being processed."
45
- :registered
46
- when "no registration status listed."
47
- :reserved
48
- # NEWSTATUS (redemption?)
49
- when "renewal required."
50
- :registered
51
- else
52
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
40
+ when "registered until renewal date."
41
+ :registered
42
+ when "registered until expiry date."
43
+ :registered
44
+ when "registration request being processed."
45
+ :registered
46
+ when "renewal request being processed."
47
+ :registered
48
+ when "no registration status listed."
49
+ :reserved
50
+ # NEWSTATUS (redemption?)
51
+ when "renewal required."
52
+ :registered
53
+ else
54
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
53
55
  end
54
56
  elsif invalid?
55
57
  :invalid
@@ -20,6 +20,7 @@ module Whois
20
20
  self.tokenizers += [
21
21
  :skip_empty_line,
22
22
  :scan_reserved,
23
+ :scan_reserved_list,
23
24
  :scan_available,
24
25
  :scan_keyvalue,
25
26
  ]
@@ -37,6 +38,12 @@ module Whois
37
38
  end
38
39
  end
39
40
 
41
+ tokenizer :scan_reserved_list do
42
+ if @input.scan(/^Sorry, The domain you requested is in the reserved list/)
43
+ @ast["status:reserved"] = true
44
+ end
45
+ end
46
+
40
47
  end
41
48
 
42
49
  end
@@ -23,6 +23,7 @@ module Whois
23
23
  :scan_contact,
24
24
  :scan_keyvalue,
25
25
  :scan_available,
26
+ :skip_application_pending,
26
27
  ]
27
28
 
28
29
  tokenizer :scan_available do
@@ -44,6 +45,13 @@ module Whois
44
45
  end
45
46
  end
46
47
 
48
+ tokenizer :skip_application_pending do
49
+ if @input.match?(/^% Application Pending/)
50
+ _scan_lines_to_array(/^%(.+)\n/)
51
+ @ast["status:pending"] = true
52
+ end
53
+ end
54
+
47
55
  end
48
56
  end
49
57
  end
@@ -13,7 +13,7 @@ module Whois
13
13
  module Version
14
14
  MAJOR = 2
15
15
  MINOR = 5
16
- PATCH = 0
16
+ PATCH = 1
17
17
  BUILD = nil
18
18
 
19
19
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
@@ -0,0 +1,12 @@
1
+ #status
2
+ should: %s == []
3
+
4
+ #available?
5
+ should: %s == false
6
+
7
+ #registered?
8
+ should: %s == true
9
+
10
+
11
+ #reserved?
12
+ should: %s == true
@@ -0,0 +1 @@
1
+ Sorry, The domain you requested is in the reserved list
@@ -0,0 +1,8 @@
1
+ #status
2
+ should: %s == :available
3
+
4
+ #available?
5
+ should: %s == true
6
+
7
+ #registered?
8
+ should: %s == false
@@ -0,0 +1,39 @@
1
+ % .be Whois Server 5.0
2
+ %
3
+ % The WHOIS service offered by DNS.be and the access to the records in the DNS.be
4
+ % WHOIS database are provided for information purposes only. It allows
5
+ % persons to check whether a specific domain name is still available or not
6
+ % and to obtain information related to the registration records of
7
+ % existing domain names.
8
+ %
9
+ % DNS.be cannot, under any circumstances, be held liable where the stored
10
+ % information would prove to be incomplete or inaccurate in any sense.
11
+ %
12
+ % By submitting a query you agree not to use the information made available
13
+ % to:
14
+ % - allow, enable or otherwise support the transmission of unsolicited,
15
+ % commercial advertising or other solicitations whether via email or otherwise;
16
+ % - target advertising in any possible way;
17
+ % - to cause nuisance in any possible way to the domain name holders by sending
18
+ % messages to them (whether by automated, electronic processes capable of
19
+ % enabling high volumes or other possible means).
20
+ %
21
+ % Without prejudice to the above, it is explicitly forbidden to extract, copy
22
+ % and/or use or re-utilise in any form and by any means (electronically or
23
+ % not) the whole or a quantitatively or qualitatively substantial part
24
+ % of the contents of the WHOIS database without prior and explicit permission
25
+ % by DNS.be, nor in any attempt thereof, to apply automated, electronic
26
+ % processes to DNS.be (or its systems).
27
+ %
28
+ % You agree that any reproduction and/or transmission of data for commercial
29
+ % purposes will always be considered as the extraction of a substantial
30
+ % part of the content of the WHOIS database.
31
+ %
32
+ % By submitting the query you agree to abide by this policy and accept that
33
+ % DNS.be can take measures to limit the use of its whois services in order to
34
+ % protect the privacy of its registrants or the integrity of the database.
35
+ %
36
+
37
+ Domain: u34jedzcq.be
38
+ Status: AVAILABLE
39
+
@@ -0,0 +1,8 @@
1
+ #status
2
+ should: %s == :available
3
+
4
+ #available?
5
+ should: %s == true
6
+
7
+ #registered?
8
+ should: %s == false
@@ -0,0 +1,41 @@
1
+ % .be Whois Server 4.0
2
+ %
3
+ % (c) dns.be 2001-2004 (http://www.dns.be)
4
+ %
5
+ %- The WHOIS service offered by DNS and the access to the records in the DNS
6
+ %- WHOIS database are provided for information purposes only. It allows
7
+ %- persons to check whether a specific domain name is still available or not
8
+ %- and to obtain information related to the registration records of
9
+ %- existing domain names.
10
+ %-
11
+ %- DNS cannot, under any circumstances, be held liable where the stored
12
+ %- information would prove to be incomplete or inaccurate in any sense.
13
+ %-
14
+ %- By submitting a query you agree not to use the information made available
15
+ %- to:
16
+ %- - allow, enable or otherwise support the transmission of unsolicited,
17
+ %- commercial advertising or other solicitations whether via email or otherwise;
18
+ %- - target advertising in any possible way;
19
+ %- - to cause nuisance in any possible way to the domain name holders by sending
20
+ %- messages to them (whether by automated, electronic processes capable of
21
+ %- enabling high volumes or other possible means).
22
+ %-
23
+ %- Without prejudice to the above, it is explicitly forbidden to extract, copy
24
+ %- and/or use or re-utilise in any form and by any means (electronically or
25
+ %- not) the whole or a quantitatively or qualitatively substantial part
26
+ %- of the contents of the WHOIS database without prior and explicit permission
27
+ %- by DNS, nor in any attempt thereof, to apply automated, electronic
28
+ %- processes to DNS (or its systems).
29
+ %-
30
+ %- You agree that any reproduction and/or transmission of data for commercial
31
+ %- purposes will always be considered as the extraction of a substantial
32
+ %- part of the content of the WHOIS database.
33
+ %-
34
+ %- By submitting the query you agree to abide by this policy and accept that
35
+ %- DNS can take measures to limit the use of its whois services in order to
36
+ %- protect the privacy of its registrants or the integrity of the database.
37
+ %-
38
+ % WHOIS u34jedzcq
39
+ Domain: u34jedzcq
40
+ Status: FREE
41
+
@@ -0,0 +1,8 @@
1
+ #status
2
+ should: %s == :registered
3
+
4
+ #available?
5
+ should: %s == false
6
+
7
+ #registered?
8
+ should: %s == true
@@ -0,0 +1,63 @@
1
+ % .be Whois Server 5.0
2
+ %
3
+ % The WHOIS service offered by DNS.be and the access to the records in the DNS.be
4
+ % WHOIS database are provided for information purposes only. It allows
5
+ % persons to check whether a specific domain name is still available or not
6
+ % and to obtain information related to the registration records of
7
+ % existing domain names.
8
+ %
9
+ % DNS.be cannot, under any circumstances, be held liable where the stored
10
+ % information would prove to be incomplete or inaccurate in any sense.
11
+ %
12
+ % By submitting a query you agree not to use the information made available
13
+ % to:
14
+ % - allow, enable or otherwise support the transmission of unsolicited,
15
+ % commercial advertising or other solicitations whether via email or otherwise;
16
+ % - target advertising in any possible way;
17
+ % - to cause nuisance in any possible way to the domain name holders by sending
18
+ % messages to them (whether by automated, electronic processes capable of
19
+ % enabling high volumes or other possible means).
20
+ %
21
+ % Without prejudice to the above, it is explicitly forbidden to extract, copy
22
+ % and/or use or re-utilise in any form and by any means (electronically or
23
+ % not) the whole or a quantitatively or qualitatively substantial part
24
+ % of the contents of the WHOIS database without prior and explicit permission
25
+ % by DNS.be, nor in any attempt thereof, to apply automated, electronic
26
+ % processes to DNS.be (or its systems).
27
+ %
28
+ % You agree that any reproduction and/or transmission of data for commercial
29
+ % purposes will always be considered as the extraction of a substantial
30
+ % part of the content of the WHOIS database.
31
+ %
32
+ % By submitting the query you agree to abide by this policy and accept that
33
+ % DNS.be can take measures to limit the use of its whois services in order to
34
+ % protect the privacy of its registrants or the integrity of the database.
35
+ %
36
+
37
+ Domain: gratisdatingplaza.be
38
+ Status: NOT AVAILABLE
39
+ Registered: Tue Feb 15 2011
40
+
41
+ Registrant:
42
+ Not shown, please visit www.dns.be for webbased whois.
43
+
44
+ Registrar Technical Contacts:
45
+ Name: R. Bashir
46
+ Organisation: AXC
47
+ Language: nl
48
+ Phone: +31.787112586
49
+ Fax: +31.787112587
50
+ Email: support@axc.nl
51
+
52
+
53
+ Registrar:
54
+ Name: AXC
55
+ Website: axc.nl/
56
+
57
+ Nameservers:
58
+ ns2594.hostgator.com
59
+ ns2593.hostgator.com
60
+
61
+ Keys:
62
+
63
+ Please visit www.dns.be for more info.
@@ -0,0 +1,8 @@
1
+ #status
2
+ should: %s == :registered
3
+
4
+ #available?
5
+ should: %s == false
6
+
7
+ #registered?
8
+ should: %s == true
@@ -0,0 +1,66 @@
1
+ % .be Whois Server 4.0
2
+ %
3
+ % (c) dns.be 2001-2004 (http://www.dns.be)
4
+ %
5
+ %- The WHOIS service offered by DNS and the access to the records in the DNS
6
+ %- WHOIS database are provided for information purposes only. It allows
7
+ %- persons to check whether a specific domain name is still available or not
8
+ %- and to obtain information related to the registration records of
9
+ %- existing domain names.
10
+ %-
11
+ %- DNS cannot, under any circumstances, be held liable where the stored
12
+ %- information would prove to be incomplete or inaccurate in any sense.
13
+ %-
14
+ %- By submitting a query you agree not to use the information made available
15
+ %- to:
16
+ %- - allow, enable or otherwise support the transmission of unsolicited,
17
+ %- commercial advertising or other solicitations whether via email or otherwise;
18
+ %- - target advertising in any possible way;
19
+ %- - to cause nuisance in any possible way to the domain name holders by sending
20
+ %- messages to them (whether by automated, electronic processes capable of
21
+ %- enabling high volumes or other possible means).
22
+ %-
23
+ %- Without prejudice to the above, it is explicitly forbidden to extract, copy
24
+ %- and/or use or re-utilise in any form and by any means (electronically or
25
+ %- not) the whole or a quantitatively or qualitatively substantial part
26
+ %- of the contents of the WHOIS database without prior and explicit permission
27
+ %- by DNS, nor in any attempt thereof, to apply automated, electronic
28
+ %- processes to DNS (or its systems).
29
+ %-
30
+ %- You agree that any reproduction and/or transmission of data for commercial
31
+ %- purposes will always be considered as the extraction of a substantial
32
+ %- part of the content of the WHOIS database.
33
+ %-
34
+ %- By submitting the query you agree to abide by this policy and accept that
35
+ %- DNS can take measures to limit the use of its whois services in order to
36
+ %- protect the privacy of its registrants or the integrity of the database.
37
+ %-
38
+ % WHOIS google
39
+ Domain: google
40
+ Status: REGISTERED
41
+ Registered: Tue Dec 12 2000
42
+
43
+ Licensee:
44
+ Not shown, please visit www.dns.be for webbased whois.
45
+
46
+ Agent Technical Contacts:
47
+ Last Name: CCOPS
48
+ Company Name: MarkMonitor
49
+ Language: en
50
+ Street: 10400 Overland Road PMB 155
51
+ Location: ID 83709-1433 Boise
52
+ Country: US
53
+ Phone: +1.2083895740
54
+ Fax: +1.2083895799
55
+ Email: ccops@markmonitor.com
56
+
57
+ Agent:
58
+ Name: MarkMonitor
59
+ Website: http://www.markmonitor.com
60
+
61
+ Nameservers:
62
+ ns1.google.com
63
+ ns2.google.com
64
+ ns3.google.com
65
+ ns4.google.com
66
+
@@ -1,41 +1,39 @@
1
- % .be Whois Server 4.0
2
- %
3
- % (c) dns.be 2001-2004 (http://www.dns.be)
4
- %
5
- %- The WHOIS service offered by DNS and the access to the records in the DNS
6
- %- WHOIS database are provided for information purposes only. It allows
7
- %- persons to check whether a specific domain name is still available or not
8
- %- and to obtain information related to the registration records of
9
- %- existing domain names.
10
- %-
11
- %- DNS cannot, under any circumstances, be held liable where the stored
12
- %- information would prove to be incomplete or inaccurate in any sense.
13
- %-
14
- %- By submitting a query you agree not to use the information made available
15
- %- to:
16
- %- - allow, enable or otherwise support the transmission of unsolicited,
17
- %- commercial advertising or other solicitations whether via email or otherwise;
18
- %- - target advertising in any possible way;
19
- %- - to cause nuisance in any possible way to the domain name holders by sending
20
- %- messages to them (whether by automated, electronic processes capable of
21
- %- enabling high volumes or other possible means).
22
- %-
23
- %- Without prejudice to the above, it is explicitly forbidden to extract, copy
24
- %- and/or use or re-utilise in any form and by any means (electronically or
25
- %- not) the whole or a quantitatively or qualitatively substantial part
26
- %- of the contents of the WHOIS database without prior and explicit permission
27
- %- by DNS, nor in any attempt thereof, to apply automated, electronic
28
- %- processes to DNS (or its systems).
29
- %-
30
- %- You agree that any reproduction and/or transmission of data for commercial
31
- %- purposes will always be considered as the extraction of a substantial
32
- %- part of the content of the WHOIS database.
33
- %-
34
- %- By submitting the query you agree to abide by this policy and accept that
35
- %- DNS can take measures to limit the use of its whois services in order to
36
- %- protect the privacy of its registrants or the integrity of the database.
37
- %-
38
- % WHOIS u34jedzcq
39
- Domain: u34jedzcq
40
- Status: FREE
41
-
1
+ % .be Whois Server 5.0
2
+ %
3
+ % The WHOIS service offered by DNS.be and the access to the records in the DNS.be
4
+ % WHOIS database are provided for information purposes only. It allows
5
+ % persons to check whether a specific domain name is still available or not
6
+ % and to obtain information related to the registration records of
7
+ % existing domain names.
8
+ %
9
+ % DNS.be cannot, under any circumstances, be held liable where the stored
10
+ % information would prove to be incomplete or inaccurate in any sense.
11
+ %
12
+ % By submitting a query you agree not to use the information made available
13
+ % to:
14
+ % - allow, enable or otherwise support the transmission of unsolicited,
15
+ % commercial advertising or other solicitations whether via email or otherwise;
16
+ % - target advertising in any possible way;
17
+ % - to cause nuisance in any possible way to the domain name holders by sending
18
+ % messages to them (whether by automated, electronic processes capable of
19
+ % enabling high volumes or other possible means).
20
+ %
21
+ % Without prejudice to the above, it is explicitly forbidden to extract, copy
22
+ % and/or use or re-utilise in any form and by any means (electronically or
23
+ % not) the whole or a quantitatively or qualitatively substantial part
24
+ % of the contents of the WHOIS database without prior and explicit permission
25
+ % by DNS.be, nor in any attempt thereof, to apply automated, electronic
26
+ % processes to DNS.be (or its systems).
27
+ %
28
+ % You agree that any reproduction and/or transmission of data for commercial
29
+ % purposes will always be considered as the extraction of a substantial
30
+ % part of the content of the WHOIS database.
31
+ %
32
+ % By submitting the query you agree to abide by this policy and accept that
33
+ % DNS.be can take measures to limit the use of its whois services in order to
34
+ % protect the privacy of its registrants or the integrity of the database.
35
+ %
36
+
37
+ Domain: u34jedzcq.be
38
+ Status: AVAILABLE
39
+