Skip to content

Commit

Permalink
Update whois.nic.af
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Oct 17, 2012
1 parent e3ca14f commit 2356893
Show file tree
Hide file tree
Showing 17 changed files with 308 additions and 242 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

- CHANGED: Renamed Whois::Record::Scanners::Ast to Renamed Whois::Record::Scanners::Nodable

- CHANGED: Updated whois.nic.af parser to the new response format.

- FIXED: whois.domainregistry.ie should support status `Active - LOCKED`.

- FIXED: whois.nic.uk fails to parse registrars without URL (GH-188).
Expand Down
102 changes: 102 additions & 0 deletions lib/whois/record/parser/base_cocca2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
#++


require 'whois/record/parser/base'


module Whois
class Record
class Parser

# Base parser for CoCCA servers.
#
# @abstract
class BaseCocca2 < Base

property_supported :domain do
content_for_scanner =~ /Domain Name: (.+)\n/
$1 || Whois.bug!(ParserError, "Unable to parse domain.")
end

property_not_supported :domain_id


property_supported :status do
if content_for_scanner =~ /Domain Status: (.+)\n/
case $1.downcase
when "ok"
:registered
when "available"
:available
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
else
Whois.bug!(ParserError, "Unable to parse status.")
end
end

property_supported :available? do
status == :available
end

property_supported :registered? do
!available?
end


property_supported :created_on do
if content_for_scanner =~ /Creation Date: (.+?)\n/
parse_time($1)
end
end

property_supported :updated_on do
if content_for_scanner =~ /Updated Date: (.+?)\n/
parse_time($1)
end
end

property_supported :expires_on do
if content_for_scanner =~ /Registry Expiry Date: (.+?)\n/
parse_time($1)
end
end


property_supported :registrar do
if content_for_scanner =~ /Sponsoring Registrar: (.+?)\n/
Record::Registrar.new(
:name => $1,
:organization => nil,
:url => content_for_scanner.slice(/Sponsoring Registrar URL: (.+)\n/, 1)
)
end
end


property_supported :nameservers do
content_for_scanner.scan(/Name Server: (.+)\n/).flatten.map do |name|
Record::Nameserver.new(:name => name)
end
end


private

def parse_time(value)
# Hack to remove usec. Do you know a better way?
Time.utc(*Time.parse(value).to_a)
end

end

end
end
end
8 changes: 6 additions & 2 deletions lib/whois/record/parser/whois.nic.af.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
#++


require 'whois/record/parser/base_cocca'
require 'whois/record/parser/base_cocca2'


module Whois
class Record
class Parser

# Parser for the whois.nic.af server.
class WhoisNicAf < BaseCocca
#
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
class WhoisNicAf < BaseCocca2
end

end
Expand Down
56 changes: 0 additions & 56 deletions spec/fixtures/responses/whois.nic.af/property_status_active.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,46 +1,10 @@
Domain Name: u34jedzcq.af
Domain Status: Available

TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by AFGNIC as a service to the internet community.

The data is for information purposes only. AFGNIC does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.

ADRAS Helpdesk | http://helpdesk.adras.af
Domain Information
Query: netlinks.af
Status: Delegated
Created: 17 Sep 2006
Modified: 01 Jan 2011
Expires: 16 Jan 2020
Name Servers:
ns1.netlynxhost.com
ns2.netlynxhost.com

Registrar Information
Registrar Name: Afghanistan Ministry of Communications
Address: AFGNIC Office
7th floor , Ministry of Communications
Muhammad Jan Khan Watt
Kabul, Afghanistan.
Country: AF
Phone: +93 20 210 2684
Customer Service Contact: afgnic@nic.af
Customer Service Email: afgnic@nic.af




Registrant:
Name: Netlinks Solutions
Address:
kabul
kabul AF
Email Address: unknown
Phone Number: UNKNOWN


Admin Contact:
Name: Farshid Ghyasi Ghyasi
Address:
kabul
kabul AF
Email Address: farshid@netlynx.com.af
Phone Number: +93 0773020100

>>> Last update of WHOIS database: 2012-10-18T01:13:42.883Z <<<

This file was deleted.

This file was deleted.

93 changes: 93 additions & 0 deletions spec/fixtures/responses/whois.nic.af/property_status_ok.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Domain Name: google.af
Domain ID: 345679-CoCCA
WHOIS Server: @ CoCCA
Referral URL:
Updated Date: 2012-04-30T14:49:02.256Z
Creation Date: 2009-10-05T03:51:17.979Z
Registry Expiry Date: 2013-05-05T03:51:17.974Z
Sponsoring Registrar: MarkMonitor
Sponsoring Registrar IANA ID:
Domain Status: ok

Registrant ID: 88185-CoCCA
Registrant Name: Google Inc.
Registrant Organization:
Registrant Street: 1600 Amphitheatre Parkway
Registrant City: Mountain View
Registrant State/Province: CA
Registrant Postal Code: 94043
Registrant Country: US
Registrant Phone: +1.6502530000
Registrant Phone Ext:
Registrant Fax: +1.6506188571
Registrant Fax Ext:
Registrant Email: dns-admin@google.com

Admin ID: 88185-CoCCA
Admin Name: Google Inc.
Admin Organization:
Admin Street: 1600 Amphitheatre Parkway
Admin City: Mountain View
Admin State/Province: CA
Admin Postal Code: 94043
Admin Country: US
Admin Phone: +1.6502530000
Admin Phone Ext:
Admin Fax: +1.6506188571
Admin Fax Ext:
Admin Email: dns-admin@google.com

Billing ID: 182402-CoCCA
Billing Name: eMarkmonitor Inc. dba MarkMonitor
Billing Organization:
Billing Street: PMB 155
Billing Street: 10400 Overland Road
Billing City: Boise
Billing State/Province: Idaho 83709
Billing Postal Code:
Billing Country: US
Billing Phone: +1 (208) 389 5799
Billing Phone Ext:
Billing Email: ccops@markmonitor.com

Tech ID: 88185-CoCCA
Tech Name: Google Inc.
Tech Organization:
Tech Street: 1600 Amphitheatre Parkway
Tech City: Mountain View
Tech State/Province: CA
Tech Postal Code: 94043
Tech Country: US
Tech Phone: +1.6502530000
Tech Phone Ext:
Tech Fax: +1.6506188571
Tech Fax Ext:
Tech Email: dns-admin@google.com

Name Server: ns1.google.com
Name Server: ns2.google.com
Name Server: ns3.google.com
Name Server: ns4.google.com

DNSSEC: unsigned


Additional Section


Sponsoring Registrar URL: http://www.markmonitor.com
Sponsoring Registrar Address: MarkMonitor Emerald Tech Center 391 N. Ancestor Place Boise, ID 83704
Sponsoring Registrar Country: US
Sponsoring Registrar Phone: +1 (208) 389-5740
Sponsoring Registrar Fax: +1 (208) 389-5771
Sponsoring Registrar Customer Service Contact: ccops@markmonitor.com
Sponsoring Registrar Customer Service Email: ccops@markmonitor.com


TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by AFGNIC as a service to the internet community.

The data is for information purposes only. AFGNIC does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.

ADRAS Helpdesk | http://helpdesk.adras.af

>>> Last update of WHOIS database: 2012-10-18T01:13:42.883Z <<<
15 changes: 6 additions & 9 deletions spec/fixtures/responses/whois.nic.af/status_available.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by CoCCA as a service to the internet community on behalf of CoCCA members. (http://www.cocca.cx/members.jsp)
Domain Name: u34jedzcq.af
Domain Status: Available

TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by AFGNIC as a service to the internet community.

The data is for information purposes only. CoCCA does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.
The data is for information purposes only. AFGNIC does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.

ADRAS Helpdesk | http://helpdesk.adras.af

Domain Information
Query: u34jedzcq.af
Status: Not Registered




>>> Last update of WHOIS database: 2012-10-18T01:13:42.883Z <<<
Loading

0 comments on commit 2356893

Please sign in to comment.