Sha256: c7de000754ad9029642cd999bb09ec2cd63ecbe74a7c0d1919d721c5ff390ee6

Contents?: true

Size: 975 Bytes

Versions: 24

Compression:

Stored size: 975 Bytes

Contents

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


module Whois
  class Server
    module Adapters

      class Pir < Base

        def request(qstring)
          response = ask_the_socket("FULL #{qstring}", "whois.publicinterestregistry.net", DEFAULT_WHOIS_PORT)
          append_to_buffer response, "whois.publicinterestregistry.net"

          if endpoint = extract_referral(response)
            response = ask_the_socket(qstring, endpoint, DEFAULT_WHOIS_PORT)
            append_to_buffer response, endpoint
          end
        end

        private

          def extract_referral(response)
            if response =~ /Registrant Name:SEE SPONSORING REGISTRAR/ && 
               response =~ /Registrant Street1:Whois Server:(\S+)/
              $1
            end
          end

      end

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
whois-1.1.8 lib/whois/server/adapters/pir.rb
whois-1.1.7 lib/whois/server/adapters/pir.rb
whois-1.1.6 lib/whois/server/adapters/pir.rb
whois-1.1.5 lib/whois/server/adapters/pir.rb
whois-1.1.4 lib/whois/server/adapters/pir.rb
whois-1.1.3 lib/whois/server/adapters/pir.rb
whois-1.1.2 lib/whois/server/adapters/pir.rb
whois-1.1.1 lib/whois/server/adapters/pir.rb
whois-1.1.0 lib/whois/server/adapters/pir.rb
whois-1.0.12 lib/whois/server/adapters/pir.rb
whois-1.0.11 lib/whois/server/adapters/pir.rb
whois-1.0.10 lib/whois/server/adapters/pir.rb
whois-1.0.9 lib/whois/server/adapters/pir.rb
whois-1.0.8 lib/whois/server/adapters/pir.rb
whois-1.0.7 lib/whois/server/adapters/pir.rb
whois-1.0.6 lib/whois/server/adapters/pir.rb
whois-1.0.5 lib/whois/server/adapters/pir.rb
whois-1.0.4 lib/whois/server/adapters/pir.rb
whois-1.0.3 lib/whois/server/adapters/pir.rb
whois-1.0.2 lib/whois/server/adapters/pir.rb