freeside/install/5.005/Net-Whois-Raw COPYRIGHT,NONE,1.1.2.1 Changes,NONE,1.1.2.1 MANIFEST,NONE,1.1.2.1 META.yml,NONE,1.1.2.1 Makefile.PL,NONE,1.1.2.1 README,NONE,1.1.2.1 pwhois,NONE,1.1.2.1

ivan ivan at pouncequick.420.am
Wed Apr 7 02:12:52 PDT 2004


Update of /home/cvs/cvsroot/freeside/install/5.005/Net-Whois-Raw
In directory pouncequick:/tmp/cvs-serv5726/Net-Whois-Raw

Added Files:
      Tag: FREESIDE_1_4_BRANCH
	COPYRIGHT Changes MANIFEST META.yml Makefile.PL README pwhois 
Log Message:
adding on 1.4 branch also


--- NEW FILE: MANIFEST ---
Changes
MANIFEST
Makefile.PL
lib/Net/Whois/Raw.pm
lib/Net/Whois/Raw/Data.pm
t/01.t
pwhois
README
COPYRIGHT
META.yml                                Module meta-data (added by MakeMaker)

--- NEW FILE: Changes ---
Revision history for Perl extension Net::Whois::Raw.

0.01  Jul 05 12:35:47 2000
	- original version; created by h2xs 1.19

0.02 - 0.22  ???
	-  ???

0.23  Mar 25 09:23:37 PST 2003
	- only exports &whois by default, the other variables are exportable still.
	- incorporated new whois servers ( thanks Toni Mueller <support at oeko.net> )
	- now tests the main tlds
	- added some more regexen to strip out disclaimers and such ( for $OMIT_MSG > 2 ).
	- moved %servers to %Net::Whois::Raw::Data::servers

0.24  Nov 18 2003	Walery Studennikov <despair at cpan.org>
	- fixed whois server for .org domains and add new whois servers
	  for multilingual domains
	- fixed recursive whois requests for .org domains
	- new fail-check and strip patterns added
	- more verbose error messages
	- added support for third level domains
	- some bugfixes

0.25  Nov 21 2003	Walery Studennikov <despair at cpan.org>
	- fixed multilingual domains whois via whois.melbourneit.com server
	- whois_config function for setting config variables
	  (if setting imported variables $OMIT_MSG, $CHECK_FAIL etc.
	  doesn't work for some reason, for example because of
	  namespace problems in mod_perl scripts)

0.26  Jan 09 2004	Walery Studennikov <despair at cpan.org>
	- added recursive whois requests for .cc domains
	- fixed recursive whois requests for whois.crsnic.net

0.27  Feb 10 2004	Alex Kapranoff <alex at kapranoff.ru>
	- patch to check availability of .info and .biz domains

0.28  Feb 20 2004	Alex Kapranoff <alex at kapranoff.ru>
	- fixed documentation for pwhois.PL

0.29  Feb 24 2004	Walery Studennikov <despair at cpan.org>
	- fixed extra rules which strips the copyright message or disclaimer
	- removed pwhois.PL. "pwhois" is shipped now instead.
	- data structures in Net/Whois/Raw/Data.pm reformatted
	- new strip patterns for whois.crsnic.net


0.30  Mar 15 2004	Walery Studennikov <despair at cpan.org>
	- added strip rules for whois.dns.be

0.31  Mar 19 2004	Walery Studennikov <despair at cpan.org>
	- more robust recursive whois queries

--- NEW FILE: META.yml ---
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
name:         Net-Whois-Raw
version:      0.29
version_from: lib/Net/Whois/Raw.pm
installdirs:  site
requires:
    IO::Socket:                    1

distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17

--- NEW FILE: README ---
NAME
    Net::Whois::Raw - Perl extension for unparsed raw whois information

SYNOPSIS
      use Net::Whois::Raw qw( whois );
  
      $s = whois('perl.com');
      $s = whois('funet.fi');
      $s = whois('yahoo.co.uk');

            ### if you do "use Net::Whois::Raw qw( whois $OMIT_MSG $CHECK_FAIL 
            ###              $CACHE_DIR $CACHE_TIME $USE_CNAMES $TIMEOUT );
            ### you can use these:

      $OMIT_MSG = 1; # This will attempt to strip several known copyright
                    messages and disclaimers sorted by servers.
                    Default is to give the whole response.

      $OMIT_MSG = 2; # This will try some additional stripping rules
                    if none are known for the spcific server.

      $CHECK_FAIL = 1; # This will return undef if the response matches
                    one of the known patterns for a failed search,
                    sorted by servers.
                    Default is to give the textual response.

      $CHECK_FAIL = 2; # This will match against several more rules
                    if none are known for the specific server.

      $CACHE_DIR = "/var/spool/pwhois/"; # Whois information will be
                    cached in this directory. Default is no cache.

      $CACHE_TIME = 24; # Cache files will be cleared after not accessed
                    for a specific number of hours. Documents will not be
                    cleared if they keep get requested for, independent
                    of disk space. Default is not to clear the cache.

      $USE_CNAMES = 1; # Use whois-servers.net to get the whois server
                    name when possible. Default is to use the 
                    hardcoded defaults.

      $TIMEOUT = 10; # Cancel the request if connection is not made within
                    a specific number of seconds.

      Note: as of version 0.21, extra data will be loaded only if the
      OMIT_MSG or CHECK_FAIL flags were used, in order to reduce memory usage.

DESCRIPTION
    Net::Whois::Raw queries NetworkSolutions and follows the Registrar:
    answer for ORG, EDU, COM and NET domains. For other TLDs it uses the
    whois-servers.net namespace. ($TLD.whois-servers.net).

    Setting the variables $OMIT_MSG and $CHECK_FAIL will match the results
    against a set of known patterns. The first flag will try to omit the
    copyright message/disclaimer, the second will attempt to determine if
    the search failed and return undef in such a case.

    IMPORTANT: these checks merely use pattern matching; they will work on
    several servers but certainly not on all of them.

    (This features were contributed by Walery Studennikov despair at sama.ru)

AUTHOR
    Original author Ariel Brosh, schop at cpan.org, Inspired by jwhois.pl
    available on the net.

    Since Ariel has passed away in September 2002:

    Past maintainers Gabor Szabo, gabor at perl.org.il, Corris Randall
    corris at cpan.org

    Current Maintainer: Walery Studennikov despair at cpan.org

CREDITS
    Fixed regular expression to match hyphens. (Peter Chow,
    peter at interq.or.jp)

    Added support for Tonga TLD. (.to) (Peter Chow, peter at interq.or.jp)

    Added support for reverse lookup of IP addresses via the ARIN registry.
    (Alex Withers awithers at gonzaga.edu)

    This will work now for RIPE addresses as well, according to a
    redirection from ARIN. (Philip Hands phil at uk.alcove.com, Trevor Peirce
    trev at digitalcon.ca)

    Added the pattern matching switches, (Walery Studennikov
    despair at sama.ru)

    Modified pattern matching, added cache. (Tony L. Svanstrom
    tony at svanstrom.org)

CHANGES
    See file "Changes" in the distribution

CLARIFICATION
    As NetworkSolutions got most of the domains of InterNic as legacy, we
    start by querying their server, as this way one whois query would be
    sufficient for many domains. Starting at whois.internic.net or
    whois.crsnic.net will result in always two requests in any case.

NOTE
    Some users complained that the die statements in the module make their
    CGI scripts crash. Please consult the entries on eval and die on
    perlfunc about exception handling in Perl.

COPYRIGHT
    Copyright 2000-2002 Ariel Brosh. Copyright 2003-2003 Gabor Szabo.
    Copyright 2003-2003 Corris Randall. Copyright 2003-2003 Walery
    Studennikov.

    This package is free software. You may redistribute it or modify it
    under the same terms as Perl itself.

    I apologize for any misunderstandings caused by the lack of a clear
    licence in previous versions.

COMMERCIAL SUPPORT
    Not available anymore.

LEGAL
    Notice that registrars forbid querying their whois servers as a part of
    a search engine, or querying for a lot of domains by script. Also,
    omitting the copyright information (that was requested by users of this
    module) is forbidden by the registrars.

SEE ALSO
    perl(1), Net::Whois, whois.


--- NEW FILE: pwhois ---
#!/usr/bin/perl -w

use Net::Whois::Raw qw( whois $OMIT_MSG $CHECK_FAIL $TIMEOUT $CACHE_DIR );
use Getopt::Std;
use strict;
use vars qw($opt_s $opt_c $opt_S $opt_C $opt_t $opt_T $opt_h);

getopts("scSCtT:h");

if ($opt_h) {
	print <<EOM;
	$0 [ -s | -S ] [ -c | -C ] [ -t <timeout> ] [ -T] <domain> [ <server> ]

The -s switch attempts to strip the copyright message or disclaimer.
The -S switch will attempt some exra rules for it.
The -c switch attempts to return an empty answer for failed searches.
The -C switch will attempt some exra rules for it.
The -T switch takes a parameter that is used for the timeout for
connection attempts.
The -t switch enables caching.
EOM
	exit; 
}


$OMIT_MSG = $CHECK_FAIL = 0;

$OMIT_MSG = 1 if $opt_s;
$OMIT_MSG = 2 if $opt_S;
$CHECK_FAIL = 1 if $opt_c;
$CHECK_FAIL = 2 if $opt_C;
$TIMEOUT = $opt_T;

$CACHE_DIR = undef;
if ($opt_t) {
    if ($^O =~ /Win/) {
        $CACHE_DIR = $ENV{'TEMP'} || "C:\\temp";
    } else {
        $CACHE_DIR = $ENV{'TEMP'} || "/tmp";
        my @ent = getpwuid($>);
        if (@ent) {
            foreach ("/tmp/$ent[0]", "$ent[7]/.pwhois") {
                mkdir $_, 0644;
                if (open(O, ">$_/__$$-$$.tmp")) {
                    close(O);
                    unlink "$_/__$$-$$.tmp";
                    $CACHE_DIR = $_;
                    last;
                 }
            }
        }
    }
}

my $dom = $ARGV[0] || die "Usage: $0 domain";

my $server = $ARGV[1];

eval {
	my $result = whois($dom, $server);
	if ($result) {
		print $result;
	} else {
		print STDERR "Failed.\n";
	}
};
if ($@) {
	my $err = $@;
	$err =~ s/\s+at \S+ line \d+\.$//;
	print "\nWhois information could not be fetched:\n$err\n";
	exit -1;
}	

__END__

=head1 NAME

pwhois   - Perl written whois client

=head1 SYNOPSIS

	pwhois perl.com
	pwhois gnu.org
	pwhois -s police.co.il
	pwhois -c there.is.no.tld.called.foobar
	pwhois yahoo.com whois.networksolutions.com
	pwhois -T 10 funet.fi

etc etc.....

=head1 DESCRIPTION

Just invoke with a domain name, optionally with a whois server name.
The B<-s> switch attempts to strip the copyright message or disclaimer.
The B<-c> switch attempts to return an empty answer for failed searches.
The B<-T> switch takes a parameter that is used for the timeout for
connection attempts.
 
=head1 AUTHOR

Ariel Brosh, B<schop at cpan.org>

=head1 SEE ALSO

L<Net::Whois::Raw>.


--- NEW FILE: Makefile.PL ---
#!/usr/bin/perl -w

use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

sub MY::postamble {
        package MY;
        shift->SUPER::postamble . <<'MAKE';
dist : README

README : lib/Net/Whois/Raw.pm
	@$(PERL) -MPod::Text -e "pod2text('$<');" > $@

MAKE
}

WriteMakefile(
    'NAME'	=> 'Net::Whois::Raw',
    'VERSION_FROM' => 'lib/Net/Whois/Raw.pm', # finds $VERSION
    'PREREQ_PM' => {'IO::Socket' => 1.0},
    'EXE_FILES' => ['pwhois'],
    'dist' => {'COMPRESS' => 'gzip --best --force'},
);

--- NEW FILE: COPYRIGHT ---
Copyright 2003-2003 Walery Studennikov
Copyright 2003-2003 Corris Randall
Copyright 2003-2003 Gabor Szabo
Copyright 2000-2002 Ariel Brosh

This package is free software. You may redistribute it or modify it under
the same terms as Perl itself.




More information about the freeside-commits mailing list