Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated in.ua parser #69

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions lib/whois/parsers/whois.in.ua.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,32 @@ class WhoisInUa < Base
end

property_supported :available? do
!!(content_for_scanner =~ /No records found for object/)
!!(content_for_scanner =~ /Domain name does not exist/)
end

property_supported :registered? do
!available?
end


property_not_supported :created_on
property_supported :created_on do
if content_for_scanner =~ /created:\s+(.*)\n/
time = $1
Time.strptime(time, "%Y-%m-%d %H:%M:%S")
end
end

property_supported :updated_on do
if content_for_scanner =~ /changed:\s+(.*)\n/
time = $1.split(" ").last
Time.strptime(time, "%Y%m%d%H%M%S")
if content_for_scanner =~ /updated:\s+(.*)\n/
time = $1
Time.strptime(time, "%Y-%m-%d %H:%M:%S")
end
end

property_supported :expires_on do
if content_for_scanner =~ /status:\s+(.*)\n/
time = $1.split(" ").last
Time.strptime(time, "%Y%m%d%H%M%S")
if content_for_scanner =~ /expires:\s+(.*)\n/
time = $1
Time.strptime(time, "%Y-%m-%d %H:%M:%S")
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
% In.UA whois server. (whois.in.ua)
% All questions regarding this service please send to [email protected]
% To search for domains and In.UA maintainers using the web, visit http://whois.in.ua
% No records found for object U34JEDZCQ.IN.UA
*
* Whois query server SUNIC
*

u34jedzcq.in.ua - Domain name does not exist
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@


#created_on
%s %ERROR{AttributeNotSupported}
%s %CLASS{time}
%s %TIME{2007-12-18 17:12:35}

#updated_on
%s %CLASS{time}
%s %TIME{2012-12-16 13:41:04}
%s %TIME{2017-12-19 09:54:31}

#expires_on
%s %CLASS{time}
%s %TIME{2013-12-18 00:00:00}
%s %TIME{2018-12-19 21:00:00}


#nameservers
%s %CLASS{array}
%s %SIZE{3}
%s[0] %CLASS{nameserver}
%s[0].name == "ns12.uadns.com"
%s[0].name == "ns10.uadns.com"
%s[1] %CLASS{nameserver}
%s[1].name == "ns11.uadns.com"
%s[1].name == "ns12.uadns.com"
%s[2] %CLASS{nameserver}
%s[2].name == "ns10.uadns.com"
%s[2].name == "ns11.uadns.com"
52 changes: 37 additions & 15 deletions spec/fixtures/responses/whois.in.ua/in.ua/status_registered.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
% In.UA whois server. (whois.in.ua)
% All questions regarding this service please send to [email protected]
% To search for domains and In.UA maintainers using the web, visit http://whois.in.ua
domain: dle.in.ua
descr: dle.in.ua
admin-c: VP535-UANIC
tech-c: NIC-UANIC
status: OK-UNTIL 20131218000000
nserver: NS12.UADNS.COM
nserver: NS11.UADNS.COM
nserver: NS10.UADNS.COM
mnt-by: DRS-MNT-INUA
mnt-lower: DRS-MNT-INUA
changed: [email protected] 20121216134104
source: INUA
*
* Whois query server SUNIC
*

domain: dle.in.ua
registrar: ua.nic
registrant: vp535-sunic
admin: vp535-sunic
tech: nic-sunic
nserver: ns10.uadns.com
nserver: ns12.uadns.com
nserver: ns11.uadns.com
status: ok
created: 2007-12-18 20:12:35
updated: 2017-12-19 12:54:31
expires: 2018-12-20 00:00:00
source: SUNIC

Contact nic-sunic
--------------------
id: nic-sunic
email: [email protected]
phone: +380.445933222
fax: +380.445937569
addr_int: not published
name_int: NIC-UANIC
org_int: NIC.UA LLC

Contact vp535-sunic
--------------------
id: vp535-sunic
email: not published
phone: not published
fax: not published
addr_loc: not published
name_loc: not published
org_loc: not published