Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add throttle detection for Network Solutions parser #182

Merged
merged 3 commits into from

3 participants

Justin Campbell Don't Add Me To Your Organization a.k.a The Travis Bot Simone Carletti
Justin Campbell

No description provided.

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 47b08ca into 4673715).

Simone Carletti
Owner

Hi @JustinCampbell, that's great. Could you also please provide a test response for this?

Justin Campbell

Updated :) thanks

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged c68d8da into dcb657f).

Simone Carletti weppos merged commit bb55553 into from
Simone Carletti
Owner

Merged, thank you very much!

Simone Carletti weppos was assigned
Simone Carletti weppos referenced this pull request from a commit
Simone Carletti Update README for GH-182 779a00e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
3  lib/whois/record/parser/whois.networksolutions.com.rb
View
@@ -81,6 +81,9 @@ class WhoisNetworksolutionsCom < Base
end
end
+ def response_throttled?
+ !!(content_for_scanner =~ /The IP address from which you have visited/)
+ end
private
2  spec/fixtures/responses/whois.networksolutions.com/response_throttled.expected
View
@@ -0,0 +1,2 @@
+#response_throttled?
+ should: %s == true
21 spec/fixtures/responses/whois.networksolutions.com/response_throttled.txt
View
@@ -0,0 +1,21 @@
+Welcome to the Network Solutions(R) Registrar WHOIS Server.
+
+The IP address from which you have visited the Network Solutions Registrar WHOIS
+database is contained within a list of IP addresses that may have failed
+to abide by Network Solutions' WHOIS policy. Failure to abide by this policy can
+adversely impact our systems and servers, preventing the processing of
+other WHOIS requests.
+
+To see the Network Solutions WHOIS Policy, click on or copy and paste the following
+URL into your browser:
+
+http://www.networksolutions.com/whois/index.jhtml
+
+If you feel that you have received this message in error, please email us using the online
+form at http://www.networksolutions.com/help/email.jsp with the following information:
+
+Whois Query: domain.com
+YOUR IP address is 12.23.34.45
+Date and Time of Query: Thu Aug 23 13:57:48 EDT 2012
+Reason Code: IE
+
3  spec/fixtures/responses/whois.networksolutions.com/status_registered.expected
View
@@ -7,6 +7,9 @@
#registered?
should: %s == true
+#response_throttled?
+ should: %s == false
+
#created_on
should: %s CLASS(time)
29 spec/whois/record/parser/responses/whois.networksolutions.com/response_throttled_spec.rb
View
@@ -0,0 +1,29 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.networksolutions.com/response_throttled.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.networksolutions.com.rb'
+
+describe Whois::Record::Parser::WhoisNetworksolutionsCom, "response_throttled.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.networksolutions.com/response_throttled.txt")
+ part = Whois::Record::Part.new(:body => File.read(file))
+ @parser = klass.new(part)
+ end
+
+ describe "#response_throttled?" do
+ it do
+ @parser.response_throttled?.should == true
+ end
+ end
+end
5 spec/whois/record/parser/responses/whois.networksolutions.com/status_registered_spec.rb
View
@@ -36,6 +36,11 @@
@parser.registered?.should == true
end
end
+ describe "#response_throttled?" do
+ it do
+ @parser.response_throttled?.should == false
+ end
+ end
describe "#created_on" do
it do
@parser.created_on.should be_a(Time)
Something went wrong with that request. Please try again.