Sha256: b2c974833c629cd6220f72b5feb0254e790dfb2da5af9c528ea70fd2551d5333

Contents?: true

Size: 976 Bytes

Versions: 24

Compression:

Stored size: 976 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.6.6 lib/whois/server/adapters/pir.rb
whois-1.6.5 lib/whois/server/adapters/pir.rb
whois-1.6.4 lib/whois/server/adapters/pir.rb
whois-1.6.3 lib/whois/server/adapters/pir.rb
whois-1.6.2 lib/whois/server/adapters/pir.rb
whois-1.6.1 lib/whois/server/adapters/pir.rb
whois-1.6.0 lib/whois/server/adapters/pir.rb
whois-1.5.1 lib/whois/server/adapters/pir.rb
whois-1.5.0 lib/whois/server/adapters/pir.rb
whois-1.3.11 lib/whois/server/adapters/pir.rb
whois-1.3.10 lib/whois/server/adapters/pir.rb
whois-1.3.9 lib/whois/server/adapters/pir.rb
whois-1.3.8 lib/whois/server/adapters/pir.rb
whois-1.3.7 lib/whois/server/adapters/pir.rb
whois-1.3.6 lib/whois/server/adapters/pir.rb
whois-1.3.5 lib/whois/server/adapters/pir.rb
whois-1.3.4 lib/whois/server/adapters/pir.rb
whois-1.3.3 lib/whois/server/adapters/pir.rb
whois-1.3.2 lib/whois/server/adapters/pir.rb
whois-1.3.1 lib/whois/server/adapters/pir.rb