line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Email::ConstantContact::Activity; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2057
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
6
|
1
|
|
|
1
|
|
7
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
7
|
1
|
|
|
1
|
|
6
|
use HTTP::Request::Common qw(POST GET); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
73
|
|
8
|
1
|
|
|
1
|
|
523
|
use XML::Simple; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use XML::Writer; |
10
|
|
|
|
|
|
|
use POSIX qw( strftime ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Email::ConstantContact::Activity - Internal class to interact with ConstantContact Activity Objects. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 VERSION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Version 0.05 |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
require Exporter; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
27
|
|
|
|
|
|
|
@EXPORT = qw( ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$VERSION = '0.05'; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Activities are asynchronous requests used when the dataset is too large |
35
|
|
|
|
|
|
|
to be handled gracefully in realtime. For example, bulk uploads or |
36
|
|
|
|
|
|
|
downloads of contact data. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This module is not typically used directly, but internally by the main |
39
|
|
|
|
|
|
|
Email::ConstantContact object for processing requests. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
use Email::ConstantContact; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $apikey = 'ABCDEFG1234567'; |
44
|
|
|
|
|
|
|
my $username = 'mycompany'; |
45
|
|
|
|
|
|
|
my $password = 'topsecret'; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
my $cc = new Email::ConstantContact($apikey, $username, $password); |
48
|
|
|
|
|
|
|
my @recent_activities = $cc->activities(); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
foreach my $activity (@recent_activities) { |
51
|
|
|
|
|
|
|
print "Found recent activity, Type= ", $activity->{Type}, "\n"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my @fields = qw ( |
57
|
|
|
|
|
|
|
id Type Status FileName TransactionCount Error RunStartTime RunFinishTime InsertTime |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub new { |
61
|
|
|
|
|
|
|
my $class = shift; |
62
|
|
|
|
|
|
|
my $ccobj = shift; |
63
|
|
|
|
|
|
|
my $data = shift; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my $self = { |
66
|
|
|
|
|
|
|
'_cc' => $ccobj, |
67
|
|
|
|
|
|
|
'Errors' => [] |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
foreach my $field (@fields) { |
71
|
|
|
|
|
|
|
$self->{$field} = $data->{'content'}->{'Activity'}->{$field}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
if (exists($data->{'link'}) && ref($data->{'link'})) { |
75
|
|
|
|
|
|
|
foreach my $link (@{$data->{'link'}}) { |
76
|
|
|
|
|
|
|
if ($link->{'rel'} eq 'edit') { |
77
|
|
|
|
|
|
|
$self->{'link'} = $link->{'href'}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
if (exists($data->{'content'}->{'Activity'}->{'Errors'}) |
83
|
|
|
|
|
|
|
&& ref($data->{'content'}->{'Activity'}->{'Errors'})) { |
84
|
|
|
|
|
|
|
$self->Errors = $data->{'content'}->{'Activity'}->{'Errors'}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
bless ($self, $class); |
88
|
|
|
|
|
|
|
return $self; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 AUTHOR |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Adam Rich, C<< >> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 BUGS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
98
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
99
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 SUPPORT |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
perldoc Email::ConstantContact::Activity |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
You can also look for information at: |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=over 4 |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
L |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
L |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item * CPAN Ratings |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
L |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * Search CPAN |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
L |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=back |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Copyright 2009-2011 Adam Rich, all rights reserved. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
142
|
|
|
|
|
|
|
under the same terms as Perl itself. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; # End of Email::ConstantContact::Activity |