File: key_count.pl

package info (click to toggle)
libnet-whois-parser-perl 0.08-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 140 kB
  • sloc: perl: 405; makefile: 4
file content (39 lines) | stat: -r-xr-xr-x 706 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl

$| = 1;

use strict;
use utf8;

use FindBin '$Bin';
use lib "$Bin/../lib";

use Net::Whois::Parser;
%Net::Whois::Parser::FIELD_NAME_CONV = ();
$Net::Whois::Raw::TIMEOUT = 10;

my %stat = ();
my $limit = 0;
for my $zone ( keys %Net::Whois::Raw::Data::servers ) {
    $zone = lc $zone;
    my $domain = "www.$zone";
    print "Get $domain ... "; 
    my $info = parse_whois(domain => $domain);

    if ( $info ) {
        $stat{$_}++ for ( keys %$info );
        print "done\n"
    }
    else {
        print "error\n";
    }
    $limit++;
    last if $limit >=3;
}

delete $stat{emails};

print
    "\nKey stat:\n\n",
    join( "\n", map { "$_: " . $stat{$_} } sort keys %stat), 
    "\n";