Skip to content
This repository

Add throttle detection for Network Solutions parser #182

Merged
merged 3 commits into from almost 2 years ago

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 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
@@ -81,6 +81,9 @@ class WhoisNetworksolutionsCom < Base
81 81 end
82 82 end
83 83
  84 + def response_throttled?
  85 + !!(content_for_scanner =~ /The IP address from which you have visited/)
  86 + end
84 87
85 88 private
86 89
2  spec/fixtures/responses/whois.networksolutions.com/response_throttled.expected
... ... @@ -0,0 +1,2 @@
  1 +#response_throttled?
  2 + should: %s == true
21 spec/fixtures/responses/whois.networksolutions.com/response_throttled.txt
... ... @@ -0,0 +1,21 @@
  1 +Welcome to the Network Solutions(R) Registrar WHOIS Server.
  2 +
  3 +The IP address from which you have visited the Network Solutions Registrar WHOIS
  4 +database is contained within a list of IP addresses that may have failed
  5 +to abide by Network Solutions' WHOIS policy. Failure to abide by this policy can
  6 +adversely impact our systems and servers, preventing the processing of
  7 +other WHOIS requests.
  8 +
  9 +To see the Network Solutions WHOIS Policy, click on or copy and paste the following
  10 +URL into your browser:
  11 +
  12 +http://www.networksolutions.com/whois/index.jhtml
  13 +
  14 +If you feel that you have received this message in error, please email us using the online
  15 +form at http://www.networksolutions.com/help/email.jsp with the following information:
  16 +
  17 +Whois Query: domain.com
  18 +YOUR IP address is 12.23.34.45
  19 +Date and Time of Query: Thu Aug 23 13:57:48 EDT 2012
  20 +Reason Code: IE
  21 +
3  spec/fixtures/responses/whois.networksolutions.com/status_registered.expected
@@ -7,6 +7,9 @@
7 7 #registered?
8 8 should: %s == true
9 9
  10 +#response_throttled?
  11 + should: %s == false
  12 +
10 13
11 14 #created_on
12 15 should: %s CLASS(time)
29 spec/whois/record/parser/responses/whois.networksolutions.com/response_throttled_spec.rb
... ... @@ -0,0 +1,29 @@
  1 +# encoding: utf-8
  2 +
  3 +# This file is autogenerated. Do not edit it manually.
  4 +# If you want change the content of this file, edit
  5 +#
  6 +# /spec/fixtures/responses/whois.networksolutions.com/response_throttled.expected
  7 +#
  8 +# and regenerate the tests with the following rake task
  9 +#
  10 +# $ rake spec:generate
  11 +#
  12 +
  13 +require 'spec_helper'
  14 +require 'whois/record/parser/whois.networksolutions.com.rb'
  15 +
  16 +describe Whois::Record::Parser::WhoisNetworksolutionsCom, "response_throttled.expected" do
  17 +
  18 + before(:each) do
  19 + file = fixture("responses", "whois.networksolutions.com/response_throttled.txt")
  20 + part = Whois::Record::Part.new(:body => File.read(file))
  21 + @parser = klass.new(part)
  22 + end
  23 +
  24 + describe "#response_throttled?" do
  25 + it do
  26 + @parser.response_throttled?.should == true
  27 + end
  28 + end
  29 +end
5 spec/whois/record/parser/responses/whois.networksolutions.com/status_registered_spec.rb
@@ -36,6 +36,11 @@
36 36 @parser.registered?.should == true
37 37 end
38 38 end
  39 + describe "#response_throttled?" do
  40 + it do
  41 + @parser.response_throttled?.should == false
  42 + end
  43 + end
39 44 describe "#created_on" do
40 45 it do
41 46 @parser.created_on.should be_a(Time)

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.