forked from weppos/whois
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
308 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
spec/fixtures/responses/whois.nic.af/property_status_active.txt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
44 changes: 4 additions & 40 deletions
44
...hois.nic.af/property_status_delegated.txt → ...hois.nic.af/property_status_available.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <<< |
8 changes: 0 additions & 8 deletions
8
spec/fixtures/responses/whois.nic.af/property_status_delegated.expected
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
spec/fixtures/responses/whois.nic.af/property_status_not_registered.txt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
93 changes: 93 additions & 0 deletions
93
spec/fixtures/responses/whois.nic.af/property_status_ok.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <<< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <<< |
Oops, something went wrong.