On 2003-02-01 (Saturday) at 01:31:49 -0600, Bill Weinman wrote:
> At 04:31 PM 1/28/03, Mark Sheppard wrote:
> >PIR's whois server uses the same format as the Afilias .info one, even
> >down to the text of the usage policy and using \r\n line endings. So
> >people shouldn't have too much trouble parsing the output.
>
> FYI: PIR uses "\r" (CR-only, like a Mac) line endings.
I'm not seeing that, what I see is \r\n plus an additional \n right at
the very end (not sure what that's about). I get this output:
NOTICE: Access to .ORG WHOIS information is provided to assist persons
in \r\ndetermining the contents of a domain name registration record
in the PIR\r\nregistry database. The data in this record is provided b
y Public Interest Registry\r\nfor informational purposes only, and PIR
does not guarantee its \r\naccuracy. This service is intended only f
or query-based access. You agree \r\nthat you will use this data only
for lawful purposes and that, under no \r\ncircumstances will you use
this data to: (a) allow, enable, or otherwise \r\nsupport the transmi
ssion by e-mail, telephone, or facsimile of mass \r\nunsolicited, comm
ercial advertising or solicitations to entities other than \r\nthe dat
a recipient's own existing customers; or (b) enable high volume, \r\na
utomated, electronic processes that send queries or data to the system
s of \r\nRegistry Operator or any ICANN-Accredited Registrar, except a
s reasonably \r\nnecessary to register domain names or modify existing
registrations. All \r\nrights reserved. PIR reserves the right to mo
dify these terms at any \r\ntime. By submitting this query, you agree
to abide by this policy. \r\n\r\nRegistrar ID:R11-LROR\r\nRegistrar Or
ganization:Tucows Inc.\r\nStreet1:96 Mowat Avenue\r\nCity:Toronto\r\nS
tate/Province:Ontario\r\nPostal Code:M6K 3M1\r\nCountry:CA\r\nPhone:+1
.4165350123\r\nFax:+1.4165315584\r\nEmail:[EMAIL PROTECTED]
g\r\nCreated On:22-Jan-2003 21:22:48 UTC\r\nLast Updated On:30-Jan-200
3 19:21:08 UTC\r\nStatus:OK\r\nBilling ID:Tucows-2\r\nBilling Name:Lev
in Saville\r\nBilling Organization:Tucows Inc.\r\nBilling Phone:+1.416
5350123\r\nBilling Fax:+1.4165315584\r\nBilling Email:[EMAIL PROTECTED]
m\r\n\r\n\n
from this program:
#!/usr/bin/perl -Tw
use strict;
use IO::Socket;
my $server = 'whois.publicinterestregistry.net';
my $request = 'registrar id R11-LROR';
my $sock = IO::Socket::INET->new(PeerAddr => $server, PeerPort => 'whois(43)')
or die "socket() failed: $!\n";
$sock->print("$request\n");
$/ = undef;
$_ = $sock->getline();
$sock->close();
s/\r/\\r/sg;
s/\n/\\n/sg;
s/(.{70})/$1\n/sg;
print "$_\n";