Sha256: 972d43313aae6da6008064b673e48131cd6537b82f904e9f7a9defc9ff9015a2

Contents?: true

Size: 1.92 KB

Versions: 7

Compression:

Stored size: 1.92 KB

Contents

#
# = Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
#
# Category::    Net
# Package::     Whois
# Author::      Simone Carletti <weppos@weppos.net>
# License::     MIT License
#
#--
#
#++


require 'whois/answer/parser/base'


module Whois
  class Answer
    class Parser

      #
      # = whois.domainregistry.my parser
      #
      # Parser for the whois.domainregistry.my 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 WhoisNicIt parser for an explanation of all available methods
      # and examples.
      #
      class WhoisDomainregistryMy < Base

        property_supported :status do
          @status ||= if available?
            :available
          else
            :registered
          end
        end

        property_supported :available? do
          @available  ||= !!(content_for_scanner =~ /Domain Name [^ ]+ does not exist in database/)
        end

        property_supported :registered? do
          @registered ||= !available?
        end


        property_supported :created_on do
          @created_on ||= if content_for_scanner =~ /\[Record Created\]\s+(.+?)\n/
            Time.parse($1)
          end
        end

        property_supported :updated_on do
          @updated_on ||= if content_for_scanner =~ /\[Record Last Modified\]\s+(.+?)\n/
            Time.parse($1)
          end
        end

        property_supported :expires_on do
          @expires_on ||= if content_for_scanner =~ /\[Record Expired\]\s+(.+?)\n/
            Time.parse($1)
          end
        end


        property_supported :nameservers do
          @nameservers ||= content_for_scanner.scan(/\[(?:Primary|Secondary) Name Server\](?:.+?)\n(.+\n)/).flatten.map { |value| value.split(" ").first }
        end

      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
whois-1.6.6 lib/whois/answer/parser/whois.domainregistry.my.rb
whois-1.6.5 lib/whois/answer/parser/whois.domainregistry.my.rb
whois-1.6.4 lib/whois/answer/parser/whois.domainregistry.my.rb
whois-1.6.3 lib/whois/answer/parser/whois.domainregistry.my.rb
whois-1.6.2 lib/whois/answer/parser/whois.domainregistry.my.rb
whois-1.6.1 lib/whois/answer/parser/whois.domainregistry.my.rb
whois-1.6.0 lib/whois/answer/parser/whois.domainregistry.my.rb