line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Results.pm,v 1.4 2003/07/21 15:37:59 matt Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Net::SenderBase::Results; |
4
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
133
|
|
5
|
4
|
|
|
4
|
|
20
|
use vars qw($AUTOLOAD); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
2019
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub cons { |
8
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
9
|
0
|
|
|
|
|
|
my ($ip, $data) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
$self->{ip} = $ip; |
14
|
0
|
|
|
|
|
|
$self->{raw_data} = $data; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
$self->parse_data; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my %keys = ( |
22
|
|
|
|
|
|
|
0 => 'version_number', |
23
|
|
|
|
|
|
|
1 => 'org_name', |
24
|
|
|
|
|
|
|
2 => 'org_daily_magnitude', |
25
|
|
|
|
|
|
|
3 => 'org_monthly_magnitude', |
26
|
|
|
|
|
|
|
4 => 'org_id', |
27
|
|
|
|
|
|
|
5 => 'org_category', |
28
|
|
|
|
|
|
|
6 => 'org_first_message', |
29
|
|
|
|
|
|
|
7 => 'org_domains_count', |
30
|
|
|
|
|
|
|
8 => 'org_ip_controlled_count', |
31
|
|
|
|
|
|
|
9 => 'org_ip_used_count', |
32
|
|
|
|
|
|
|
10 => 'org_fortune_1000', |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
20 => 'hostname', |
35
|
|
|
|
|
|
|
21 => 'domain_name', |
36
|
|
|
|
|
|
|
22 => 'hostname_matches_ip', |
37
|
|
|
|
|
|
|
23 => 'domain_daily_magnitude', |
38
|
|
|
|
|
|
|
24 => 'domain_monthly_magnitude', |
39
|
|
|
|
|
|
|
25 => 'domain_first_message', |
40
|
|
|
|
|
|
|
26 => 'domain_rating', |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
40 => 'ip_daily_magnitude', |
43
|
|
|
|
|
|
|
41 => 'ip_monthly_magnitude', |
44
|
|
|
|
|
|
|
43 => 'ip_average_magnitude', |
45
|
|
|
|
|
|
|
44 => 'ip_30_day_volume_percent', |
46
|
|
|
|
|
|
|
45 => 'ip_in_bonded_sender', |
47
|
|
|
|
|
|
|
46 => 'ip_cidr_range', |
48
|
|
|
|
|
|
|
47 => 'ip_blacklist_score', |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
50 => 'ip_city', |
51
|
|
|
|
|
|
|
51 => 'ip_state', |
52
|
|
|
|
|
|
|
52 => 'ip_postal_code', |
53
|
|
|
|
|
|
|
53 => 'ip_country', |
54
|
|
|
|
|
|
|
54 => 'ip_longitude', |
55
|
|
|
|
|
|
|
55 => 'ip_latitude', |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my %methods = (ip => 1, raw_data => 1, reverse(%keys)); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub parse_data { |
61
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
foreach my $part (split(/\|/, $self->{raw_data})) { |
64
|
0
|
|
|
|
|
|
my ($key, $value) = split(/=/, $part, 2); |
65
|
0
|
0
|
|
|
|
|
if (exists($keys{$key})) { |
66
|
0
|
|
|
|
|
|
$self->{$keys{$key}} = $value; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
else { |
69
|
|
|
|
|
|
|
# new key - please inform AUTHOR! |
70
|
0
|
|
|
|
|
|
$self->{"key_$key"} = $value; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub AUTOLOAD { |
76
|
0
|
|
|
0
|
|
|
my $self = shift; |
77
|
0
|
|
|
|
|
|
my $method = $AUTOLOAD; |
78
|
0
|
|
|
|
|
|
$method =~ s/.*:://; |
79
|
0
|
0
|
|
|
|
|
die "No such method: $method" unless exists($methods{$method}); |
80
|
0
|
|
|
|
|
|
return $self->{$method}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
__END__ |