rubywhois-ruby

Remove disclaimer and other properties from plain-text Whois


I am using the ruby whois gem and i would like to know if there is a way to return the plain-text format without the disclaimer.

Here's an example of a .eu domain :

% The WHOIS service offered by EURid and the access to the records
% in the EURid WHOIS database are provided for information purposes
% only. It allows persons to check whether a specific domain name
% is still available or not and to obtain information related to
% the registration records of existing domain names.
%
% EURid cannot, under any circumstances, be held liable in case the
% stored information would prove to be wrong, incomplete or not
% accurate in any sense.
%
% By submitting a query you agree not to use the information made
% available to:
%
% - allow, enable or otherwise support the transmission of unsolicited,
%   commercial advertising or other solicitations whether via email or
%   otherwise;
% - target advertising in any possible way;
%
% - to cause nuisance in any possible way to the registrants by sending
%   (whether by automated, electronic processes capable of enabling
%   high volumes or other possible means) messages to them.
%
% Without prejudice to the above, it is explicitly forbidden to extract,
% copy and/or use or re-utilise in any form and by any means
% (electronically or not) the whole or a quantitatively or qualitatively
% substantial part of the contents of the WHOIS database without prior
% and explicit permission by EURid, nor in any attempt hereof, to apply
% automated, electronic processes to EURid (or its systems).
%
% You agree that any reproduction and/or transmission of data for
% commercial purposes will always be considered as the extraction of a
% substantial part of the content of the WHOIS database.
%
% By submitting the query you agree to abide by this policy and accept
% that EURid can take measures to limit the use of its WHOIS services
% in order to protect the privacy of its registrants or the integrity
% of the database.
%
% The EURid WHOIS service on port 43 (textual whois) never
% discloses any information concerning the registrant.
% Registrant and onsite contact information can be obtained through use of the
% webbased whois service available from the EURid website www.eurid.eu
%
% WHOIS xxxxxx.eu
Domain: xxxxxx.eu

Registrant:
        NOT DISCLOSED!
        Visit www.eurid.eu for webbased whois.

Onsite(s):
        NOT DISCLOSED!
        Visit www.eurid.eu for webbased whois.

Registrar:
        Name: ???
        Website: ???

Name servers:
        ???
        ???
        ???

Please visit www.eurid.eu for more info.

I don't think using a regex is a good solution since every whois server has its own format, and i don't want to use the parser yet. Thank you in advance !


Solution

  • No, there is no built-in feature. For some parsers the library is able to extract the disclaimer using the #disclaimer method, however the disclaimer is then prepared for further consumption, therefore you cannot match against it.

    Short answer, that's not possible at the current state of the library.