Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add .POST TLD definition and full parser (closes GH-192)

  • Loading branch information...
commit 4fbe0e16396774c326f4b23e13d90c7dbd43b202 1 parent 994c70a
@weppos authored
View
4 CHANGELOG.md
@@ -3,8 +3,12 @@
## master
+- SERVER: Added .POST TLD definition (GH-192).
+
- NEW: Added #domain and #registrar to whois.dns.be parser (GH-216). [Thanks @chuckadams]
+- NEW: Added full whois.dotpostregistry.net parser (GH-192).
+
- CHANGED: Rescue all SystemCallError instead of a few Errno errors (GH-212). [Thanks @mat813]
- FIXED: whois.ua should support status `ok`.
View
3  data/tld.json
@@ -879,6 +879,9 @@
"adapter": "web",
"url": "http://www.pitcairn.pn/PnRegistry/"
},
+ ".post": {
+ "host": "whois.dotpostregistry.net"
+ },
".pr": {
"host": "whois.nic.pr"
},
View
27 lib/whois/record/parser/whois.dotpostregistry.net.rb
@@ -0,0 +1,27 @@
+#--
+# Ruby Whois
+#
+# An intelligent pure Ruby WHOIS client and parser.
+#
+# Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
+#++
+
+
+require 'whois/record/parser/base_afilias'
+
+
+module Whois
+ class Record
+ class Parser
+
+ # Parser for the whois.dotpostregistry.net server.
+ #
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
+ #
+ class WhoisDotpostregistryNet < BaseAfilias
+ end
+
+ end
+ end
+end
View
50 spec/fixtures/responses/whois.dotpostregistry.net/status_available.expected
@@ -0,0 +1,50 @@
+#disclaimer
+ should: %s == nil
+
+
+#domain
+ should: %s == nil
+
+#domain_id
+ should: %s == nil
+
+
+#status
+ should: %s == []
+
+#available?
+ should: %s == true
+
+#registered?
+ should: %s == false
+
+
+#created_on
+ should: %s == nil
+
+#updated_on
+ should: %s == nil
+
+#expires_on
+ should: %s == nil
+
+
+#registrar
+ should: %s == nil
+
+#registrant_contacts
+ should: %s CLASS(array)
+ should: %s == []
+
+#admin_contacts
+ should: %s CLASS(array)
+ should: %s == []
+
+#technical_contacts
+ should: %s CLASS(array)
+ should: %s == []
+
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s == []
View
1  spec/fixtures/responses/whois.dotpostregistry.net/status_available.txt
@@ -0,0 +1 @@
+NOT FOUND
View
99 spec/fixtures/responses/whois.dotpostregistry.net/status_registered.expected
@@ -0,0 +1,99 @@
+#disclaimer
+ should: %s == "Access to .POST REGISTRY WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the .POST Registry registry database. The data in this record is provided by .POST Registry for informational purposes only, and .POST Registry does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Afilias except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. .POST Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy."
+
+
+#domain
+ should: %s == "posteitaliane.post"
+
+#domain_id
+ should: %s == "D19482-POST"
+
+
+#status
+ should: %s == ["TRANSFER PROHIBITED"]
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
+
+
+#created_on
+ should: %s CLASS(time)
+ should: %s == Time.parse("2012-09-21 12:03:07 UTC")
+
+#updated_on
+ should: %s CLASS(time)
+ should: %s == Time.parse("2012-09-21 12:07:40 UTC")
+
+#expires_on
+ should: %s CLASS(time)
+ should: %s == Time.parse("2014-09-21 12:03:07 UTC")
+
+
+#registrar
+ should: %s CLASS(registrar)
+ should: %s.id == "R4947-POST"
+ should: %s.name == "Universal Postal Union"
+ should: %s.organization == "Universal Postal Union"
+
+#registrant_contacts
+ should: %s CLASS(array)
+ should: %s SIZE(1)
+ should: %s[0] CLASS(contact)
+ should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
+ should: %s[0].id == "ITPI30001"
+ should: %s[0].name == "Poste Italiane"
+ should: %s[0].organization == "Poste Italiane"
+ should: %s[0].address == "Viale Europa 190"
+ should: %s[0].city == "Rome"
+ should: %s[0].zip == "00144"
+ should: %s[0].state == ""
+ should: %s[0].country_code == "IT"
+ should: %s[0].phone == "+39.0659581"
+ should: %s[0].fax == "+39.065942298"
+ should: %s[0].email == "info@poste.it"
+
+#admin_contacts
+ should: %s CLASS(array)
+ should: %s SIZE(1)
+ should: %s[0] CLASS(contact)
+ should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN
+ should: %s[0].id == "UPU_C1002"
+ should: %s[0].name == "Giovanni Brardinoni"
+ should: %s[0].organization == "Poste Italiane"
+ should: %s[0].address == "Viale Europa 175"
+ should: %s[0].city == "Rome"
+ should: %s[0].zip == "00144"
+ should: %s[0].state == ""
+ should: %s[0].country_code == "IT"
+ should: %s[0].phone == "+39.0659583671"
+ should: %s[0].fax == "+39.0698688651"
+ should: %s[0].email == "brardinonig@posteitaliane.it"
+
+#technical_contacts
+ should: %s CLASS(array)
+ should: %s SIZE(1)
+ should: %s[0] CLASS(contact)
+ should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL
+ should: %s[0].id == "UPU_C1001"
+ should: %s[0].name == "Andrea Speranza"
+ should: %s[0].organization == "Poste Italiane"
+ should: %s[0].address == "Viale Europa 175"
+ should: %s[0].city == "Rome"
+ should: %s[0].zip == "00144"
+ should: %s[0].state == ""
+ should: %s[0].country_code == "IT"
+ should: %s[0].phone == "+39.0659583086"
+ should: %s[0].fax == "+39.0659582032"
+ should: %s[0].email == "netsecurity@postecom.it"
+
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s SIZE(2)
+ should: %s[0] CLASS(nameserver)
+ should: %s[0].name == "dns.poste.it"
+ should: %s[1] CLASS(nameserver)
+ should: %s[1].name == "dns2.poste.it"
View
106 spec/fixtures/responses/whois.dotpostregistry.net/status_registered.txt
@@ -0,0 +1,106 @@
+Access to .POST REGISTRY WHOIS information is provided to assist persons in
+determining the contents of a domain name registration record in the
+.POST Registry registry database. The data in this record is provided by
+.POST Registry for informational purposes only, and .POST Registry does not
+guarantee its accuracy. This service is intended only for query-based
+access. You agree that you will use this data only for lawful purposes
+and that, under no circumstances will you use this data to: (a) allow,
+enable, or otherwise support the transmission by e-mail, telephone, or
+facsimile of mass unsolicited, commercial advertising or solicitations
+to entities other than the data recipient's own existing customers; or
+(b) enable high volume, automated, electronic processes that send
+queries or data to the systems of Registry Operator, a Registrar, or
+Afilias except as reasonably necessary to register domain names or
+modify existing registrations. All rights reserved. .POST Registry reserves
+the right to modify these terms at any time. By submitting this query,
+you agree to abide by this policy.
+
+Domain ID:D19482-POST
+Domain Name:POSTEITALIANE.POST
+Created On:21-Sep-2012 12:03:07 UTC
+Last Updated On:21-Sep-2012 12:07:40 UTC
+Expiration Date:21-Sep-2014 12:03:07 UTC
+Sponsoring Registrar:Universal Postal Union (R4947-POST)
+Status:TRANSFER PROHIBITED
+Registrant ID:ITPI30001
+Registrant Name:Poste Italiane
+Registrant Organization:Poste Italiane
+Registrant Street1:Viale Europa 190
+Registrant Street2:
+Registrant Street3:
+Registrant City:Rome
+Registrant State/Province:
+Registrant Postal Code:00144
+Registrant Country:IT
+Registrant Phone:+39.0659581
+Registrant Phone Ext.:
+Registrant FAX:+39.065942298
+Registrant FAX Ext.:
+Registrant Email:info@poste.it
+Admin ID:UPU_C1002
+Admin Name:Giovanni Brardinoni
+Admin Organization:Poste Italiane
+Admin Street1:Viale Europa 175
+Admin Street2:
+Admin Street3:
+Admin City:Rome
+Admin State/Province:
+Admin Postal Code:00144
+Admin Country:IT
+Admin Phone:+39.0659583671
+Admin Phone Ext.:
+Admin FAX:+39.0698688651
+Admin FAX Ext.:
+Admin Email:brardinonig@posteitaliane.it
+Billing ID:UPU_C1003
+Billing Name:Plautina Loreti
+Billing Organization:Poste Italiane
+Billing Street1:Viale Europa 175
+Billing Street2:
+Billing Street3:
+Billing City:Rome
+Billing State/Province:
+Billing Postal Code:00144
+Billing Country:IT
+Billing Phone:+39.0659585699
+Billing Phone Ext.:
+Billing FAX:+39.0659589591
+Billing FAX Ext.:
+Billing Email:loretip@posteitaliane.it
+Tech ID:UPU_C1001
+Tech Name:Andrea Speranza
+Tech Organization:Poste Italiane
+Tech Street1:Viale Europa 175
+Tech Street2:
+Tech Street3:
+Tech City:Rome
+Tech State/Province:
+Tech Postal Code:00144
+Tech Country:IT
+Tech Phone:+39.0659583086
+Tech Phone Ext.:
+Tech FAX:+39.0659582032
+Tech FAX Ext.:
+Tech Email:netsecurity@postecom.it
+Name Server:DNS.POSTE.IT
+Name Server:DNS2.POSTE.IT
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+Name Server:
+DNSSEC:Signed
+DS Created 1:21-Sep-2012 12:04:45 UTC
+DS Key Tag 1:43356
+Algorithm 1:7
+Digest Type 1:1
+Digest 1:DB013B5320B837FB3DF1F6A3ADCEA54910729ECB
+DS Maximum Signature Life 1:3456000 seconds
+
+
View
98 spec/whois/record/parser/responses/whois.dotpostregistry.net/status_available_spec.rb
@@ -0,0 +1,98 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.dotpostregistry.net/status_available.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.dotpostregistry.net.rb'
+
+describe Whois::Record::Parser::WhoisDotpostregistryNet, "status_available.expected" do
+
+ subject do
+ file = fixture("responses", "whois.dotpostregistry.net/status_available.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ described_class.new(part)
+ end
+
+ describe "#disclaimer" do
+ it do
+ subject.disclaimer.should == nil
+ end
+ end
+ describe "#domain" do
+ it do
+ subject.domain.should == nil
+ end
+ end
+ describe "#domain_id" do
+ it do
+ subject.domain_id.should == nil
+ end
+ end
+ describe "#status" do
+ it do
+ subject.status.should == []
+ end
+ end
+ describe "#available?" do
+ it do
+ subject.available?.should == true
+ end
+ end
+ describe "#registered?" do
+ it do
+ subject.registered?.should == false
+ end
+ end
+ describe "#created_on" do
+ it do
+ subject.created_on.should == nil
+ end
+ end
+ describe "#updated_on" do
+ it do
+ subject.updated_on.should == nil
+ end
+ end
+ describe "#expires_on" do
+ it do
+ subject.expires_on.should == nil
+ end
+ end
+ describe "#registrar" do
+ it do
+ subject.registrar.should == nil
+ end
+ end
+ describe "#registrant_contacts" do
+ it do
+ subject.registrant_contacts.should be_a(Array)
+ subject.registrant_contacts.should == []
+ end
+ end
+ describe "#admin_contacts" do
+ it do
+ subject.admin_contacts.should be_a(Array)
+ subject.admin_contacts.should == []
+ end
+ end
+ describe "#technical_contacts" do
+ it do
+ subject.technical_contacts.should be_a(Array)
+ subject.technical_contacts.should == []
+ end
+ end
+ describe "#nameservers" do
+ it do
+ subject.nameservers.should be_a(Array)
+ subject.nameservers.should == []
+ end
+ end
+end
View
147 spec/whois/record/parser/responses/whois.dotpostregistry.net/status_registered_spec.rb
@@ -0,0 +1,147 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.dotpostregistry.net/status_registered.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.dotpostregistry.net.rb'
+
+describe Whois::Record::Parser::WhoisDotpostregistryNet, "status_registered.expected" do
+
+ subject do
+ file = fixture("responses", "whois.dotpostregistry.net/status_registered.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ described_class.new(part)
+ end
+
+ describe "#disclaimer" do
+ it do
+ subject.disclaimer.should == "Access to .POST REGISTRY WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the .POST Registry registry database. The data in this record is provided by .POST Registry for informational purposes only, and .POST Registry does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Afilias except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. .POST Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy."
+ end
+ end
+ describe "#domain" do
+ it do
+ subject.domain.should == "posteitaliane.post"
+ end
+ end
+ describe "#domain_id" do
+ it do
+ subject.domain_id.should == "D19482-POST"
+ end
+ end
+ describe "#status" do
+ it do
+ subject.status.should == ["TRANSFER PROHIBITED"]
+ end
+ end
+ describe "#available?" do
+ it do
+ subject.available?.should == false
+ end
+ end
+ describe "#registered?" do
+ it do
+ subject.registered?.should == true
+ end
+ end
+ describe "#created_on" do
+ it do
+ subject.created_on.should be_a(Time)
+ subject.created_on.should == Time.parse("2012-09-21 12:03:07 UTC")
+ end
+ end
+ describe "#updated_on" do
+ it do
+ subject.updated_on.should be_a(Time)
+ subject.updated_on.should == Time.parse("2012-09-21 12:07:40 UTC")
+ end
+ end
+ describe "#expires_on" do
+ it do
+ subject.expires_on.should be_a(Time)
+ subject.expires_on.should == Time.parse("2014-09-21 12:03:07 UTC")
+ end
+ end
+ describe "#registrar" do
+ it do
+ subject.registrar.should be_a(Whois::Record::Registrar)
+ subject.registrar.id.should == "R4947-POST"
+ subject.registrar.name.should == "Universal Postal Union"
+ subject.registrar.organization.should == "Universal Postal Union"
+ end
+ end
+ describe "#registrant_contacts" do
+ it do
+ subject.registrant_contacts.should be_a(Array)
+ subject.registrant_contacts.should have(1).items
+ subject.registrant_contacts[0].should be_a(Whois::Record::Contact)
+ subject.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
+ subject.registrant_contacts[0].id.should == "ITPI30001"
+ subject.registrant_contacts[0].name.should == "Poste Italiane"
+ subject.registrant_contacts[0].organization.should == "Poste Italiane"
+ subject.registrant_contacts[0].address.should == "Viale Europa 190"
+ subject.registrant_contacts[0].city.should == "Rome"
+ subject.registrant_contacts[0].zip.should == "00144"
+ subject.registrant_contacts[0].state.should == ""
+ subject.registrant_contacts[0].country_code.should == "IT"
+ subject.registrant_contacts[0].phone.should == "+39.0659581"
+ subject.registrant_contacts[0].fax.should == "+39.065942298"
+ subject.registrant_contacts[0].email.should == "info@poste.it"
+ end
+ end
+ describe "#admin_contacts" do
+ it do
+ subject.admin_contacts.should be_a(Array)
+ subject.admin_contacts.should have(1).items
+ subject.admin_contacts[0].should be_a(Whois::Record::Contact)
+ subject.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
+ subject.admin_contacts[0].id.should == "UPU_C1002"
+ subject.admin_contacts[0].name.should == "Giovanni Brardinoni"
+ subject.admin_contacts[0].organization.should == "Poste Italiane"
+ subject.admin_contacts[0].address.should == "Viale Europa 175"
+ subject.admin_contacts[0].city.should == "Rome"
+ subject.admin_contacts[0].zip.should == "00144"
+ subject.admin_contacts[0].state.should == ""
+ subject.admin_contacts[0].country_code.should == "IT"
+ subject.admin_contacts[0].phone.should == "+39.0659583671"
+ subject.admin_contacts[0].fax.should == "+39.0698688651"
+ subject.admin_contacts[0].email.should == "brardinonig@posteitaliane.it"
+ end
+ end
+ describe "#technical_contacts" do
+ it do
+ subject.technical_contacts.should be_a(Array)
+ subject.technical_contacts.should have(1).items
+ subject.technical_contacts[0].should be_a(Whois::Record::Contact)
+ subject.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
+ subject.technical_contacts[0].id.should == "UPU_C1001"
+ subject.technical_contacts[0].name.should == "Andrea Speranza"
+ subject.technical_contacts[0].organization.should == "Poste Italiane"
+ subject.technical_contacts[0].address.should == "Viale Europa 175"
+ subject.technical_contacts[0].city.should == "Rome"
+ subject.technical_contacts[0].zip.should == "00144"
+ subject.technical_contacts[0].state.should == ""
+ subject.technical_contacts[0].country_code.should == "IT"
+ subject.technical_contacts[0].phone.should == "+39.0659583086"
+ subject.technical_contacts[0].fax.should == "+39.0659582032"
+ subject.technical_contacts[0].email.should == "netsecurity@postecom.it"
+ end
+ end
+ describe "#nameservers" do
+ it do
+ subject.nameservers.should be_a(Array)
+ subject.nameservers.should have(2).items
+ subject.nameservers[0].should be_a(Whois::Record::Nameserver)
+ subject.nameservers[0].name.should == "dns.poste.it"
+ subject.nameservers[1].should be_a(Whois::Record::Nameserver)
+ subject.nameservers[1].name.should == "dns2.poste.it"
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.