line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DVDProfiler; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
47181
|
use LWP::UserAgent; |
|
1
|
|
|
|
|
57084
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
684
|
use Net::DVDProfiler::DVD; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
326
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.03; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
1
|
|
my $ref = shift; |
10
|
0
|
|
0
|
|
|
|
my $class = ref( $ref ) || $ref; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my $self = bless { |
13
|
|
|
|
|
|
|
lwp => new LWP::UserAgent( cookie_jar => {} ), |
14
|
|
|
|
|
|
|
alias => undef, |
15
|
|
|
|
|
|
|
@_ |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
die "DVDProfiler requires an alias." unless ( $self->{alias} ); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
$self->{lwp}->get( 'http://www.dvdprofiler.com/mycollection.asp?alias=' . $self->{alias} ); |
21
|
0
|
|
|
|
|
|
$self->{lwp}->get( 'http://www.dvdprofiler.com/mycollection.asp?acceptadult=true&alias=' . $self->{alias} ); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub getAll { |
27
|
0
|
|
|
0
|
1
|
|
return $_[0]->getList( 'A' ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub getOwned { |
31
|
0
|
|
|
0
|
1
|
|
return $_[0]->getList( 'O' ); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub getOrdered { |
35
|
0
|
|
|
0
|
1
|
|
return $_[0]->getList( 'P' ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub getWishlist { |
39
|
0
|
|
|
0
|
1
|
|
return $_[0]->getList( 'W' ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub getList { |
43
|
0
|
|
|
0
|
0
|
|
my ( $self, $type ) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
my @upcs; |
46
|
0
|
|
|
|
|
|
my $page = $u->get( 'http://www.dvdprofiler.com/dvdpro/mycollection/styles/Default/list.asp?type=' . $type )->content(); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
while ( $page =~ /id="([^"]*)".*?entry">(.*?)<\/A>/g ) { |
49
|
0
|
|
|
|
|
|
push( @upcs, new Net::DVDProfiler::DVD( upc => $1, title => $2 ) ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return @upcs; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |