line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Tracking; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
113143
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
108
|
|
4
|
4
|
|
|
4
|
|
12
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
115
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
13
|
use base 'Class::Accessor::Fast'; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1693
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
10085
|
use Carp::Clan 'croak'; |
|
4
|
|
|
|
|
6381
|
|
|
4
|
|
|
|
|
19
|
|
11
|
4
|
|
|
4
|
|
466
|
use Scalar::Util 'weaken'; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
240
|
|
12
|
4
|
|
|
4
|
|
1355
|
use WWW::Tracking::Data; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
20
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw{ |
15
|
|
|
|
|
|
|
tracker_account |
16
|
|
|
|
|
|
|
tracker_type |
17
|
|
|
|
|
|
|
tracker_url |
18
|
|
|
|
|
|
|
data |
19
|
|
|
|
|
|
|
}); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
5
|
|
|
5
|
1
|
1637
|
my $class = shift; |
23
|
5
|
|
|
|
|
45
|
my $self = $class->SUPER::new({ |
24
|
|
|
|
|
|
|
@_ |
25
|
|
|
|
|
|
|
}); |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
47
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub from { |
31
|
4
|
|
|
4
|
1
|
738
|
my $self = shift; |
32
|
4
|
|
|
|
|
6
|
my $type = shift; |
33
|
4
|
|
|
|
|
6
|
my $args = shift; |
34
|
|
|
|
|
|
|
|
35
|
4
|
|
|
|
|
10
|
my $from_type = 'from_'.$type; |
36
|
|
|
|
|
|
|
|
37
|
4
|
50
|
|
|
|
36
|
croak 'no such data plugin for "'.$type.'"' |
38
|
|
|
|
|
|
|
unless WWW::Tracking::Data->can($from_type); |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
|
|
21
|
my $tracking_data = WWW::Tracking::Data->$from_type($args); |
41
|
4
|
|
|
|
|
16
|
weaken($self); |
42
|
4
|
|
|
|
|
21
|
$tracking_data->_tracking($self); |
43
|
4
|
100
|
|
|
|
34
|
$tracking_data->new_visitor_id |
44
|
|
|
|
|
|
|
unless $tracking_data->visitor_id; |
45
|
|
|
|
|
|
|
|
46
|
4
|
|
|
|
|
24
|
$self->data($tracking_data); |
47
|
|
|
|
|
|
|
|
48
|
4
|
|
|
|
|
23
|
return $self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub make_tracking_request { |
52
|
2
|
|
|
2
|
1
|
489
|
my $self = shift; |
53
|
|
|
|
|
|
|
|
54
|
2
|
50
|
|
|
|
6
|
my $tracker_type = $self->tracker_type or croak 'tracker type not set'; |
55
|
2
|
|
|
|
|
13
|
my $tracker_function = 'make_tracking_request_'.$tracker_type; |
56
|
|
|
|
|
|
|
|
57
|
2
|
50
|
|
|
|
5
|
croak 'no tracking with '.$tracker_type.'possible' |
58
|
|
|
|
|
|
|
unless $self->data->can($tracker_function); |
59
|
|
|
|
|
|
|
|
60
|
2
|
|
|
|
|
18
|
return $self->data->$tracker_function; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |