Skip to content

Loading…

Added a whois.networksolutions.com parser. #167

Closed
wants to merge 5 commits into from

2 participants

@bramp

Parses most of the info, and has test cases.

@weppos weppos commented on the diff
lib/whois/record/parser/whois.networksolutions.com.rb
((16 lines not shown))
+ class Parser
+
+ # Parser for the whois.networksolutions.com 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 WhoisNetworksolutionsCom < Base
+
+ property_not_supported :status
+
+ # The server is contacted only in case of a registered domain.
+ property_not_supported :available?
@weppos Owner
weppos added a note

Please list the properties as supported, with a hard-coded value.

# The server is contacted only in case of a registered domain.
property_supported :available? do
  false
end

property_supported :registered? do
  !available?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weppos weppos commented on the diff
lib/whois/record/parser/whois.networksolutions.com.rb
((19 lines not shown))
+ #
+ # @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 WhoisNetworksolutionsCom < Base
+
+ property_not_supported :status
+
+ # The server is contacted only in case of a registered domain.
+ property_not_supported :available?
+ property_not_supported :registered?
+
+ property_not_supported :registrar
@weppos Owner
weppos added a note

Please set a hard-coded value. We already know this is Networksolution.

property_supported :registrar do
  Record::Registrar.new(
      :name => 'Network Solutions',
      :organization => 'Network Solutions, LLC',
      :url  => 'http://www.networksolutions.com/'
  )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weppos weppos commented on the diff
lib/whois/record/parser/whois.networksolutions.com.rb
@@ -0,0 +1,130 @@
+#--
+# Ruby Whois
+#
+# An intelligent pure Ruby WHOIS client and parser.
+#
+# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
+# Copyright (c) 2012 Andrew Brampton <me@bramp.net>
@weppos Owner
weppos added a note

Please don't change the global copyright. Use the @author tag in the class.

Here's an example
https://github.com/weppos/whois/blob/master/lib/whois/record/parser/whois.co.ug.rb#L26-27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weppos weppos commented on the diff
...whois.networksolutions.com/status_registered.expected
((65 lines not shown))
+ should: %s[0].name == "Communications, XIF ContactMiddleName"
+ should: %s[0].organization == "XIF Communications"
+ should: %s[0].address == "1200 New Hampshire Avenue NW\nSuite 410"
+ should: %s[0].city == "Washington"
+ should: %s[0].zip == "20036"
+ should: %s[0].state == "DC"
+ should: %s[0].country_code == "US"
+ should: %s[0].phone == "202-463-7200"
+ should: %s[0].fax == "202-318-4003"
+ should: %s[0].email == "noc@xif.com"
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s SIZE(3)
+ should: %s[0] CLASS(nameserver)
+ should: %s[0] == _nameserver.new(:name => "NS01.XIF.COM", :ipv4 => "63.240.200.70")
@weppos Owner
weppos added a note

Please separate the properties. Use

should: %s[0].name == "NS01.XIF.COM"
should: %s[0].ipv4 =="63.240.200.70"

instead of

should: %s[0] == _nameserver.new(:name => "NS01.XIF.COM", :ipv4 => "63.240.200.70")

Also keep in mind nameserver names should always be lower case in the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weppos
Owner

Thanks for the patch, Andrew.

It looks great! I just posted a few notes.

-- Simone

@weppos
Owner

Duplicates #168

@weppos weppos closed this
@weppos weppos was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.