Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

80 lines (63 sloc) 1.909 kb
#--
# 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
# Parser for the whois.dns.pl server.
#
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
#
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
class WhoisDnsPl < Base
property_supported :status do
if available?
:available
else
:registered
end
end
property_supported :available? do
!!(content_for_scanner =~ /^No information available about domain name/)
end
property_supported :registered? do
!available?
end
property_supported :created_on do
if content_for_scanner =~ /created:\s+(.+?)\n/
Time.parse($1)
end
end
property_supported :updated_on do
if content_for_scanner =~ /last modified:\s+(.+?)\n/
Time.parse($1)
end
end
property_supported :expires_on do
if content_for_scanner =~ /renewal date:\s+(.+?)\n/
Time.parse($1)
end
end
property_supported :nameservers do
content_for_scanner.scan(/nameservers:\s+(.+)\n(.+)\n/).flatten.map do |line|
line.strip!
if line =~ /(.+) \[(.+)\]/
Record::Nameserver.new(:name => $1.chomp("."), :ipv4 => $2)
else
Record::Nameserver.new(:name => line.chomp("."))
end
end
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.