| 1 | package Net::DVDProfiler; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use LWP::UserAgent; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use Net::DVDProfiler::DVD; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | our $VERSION = 0.03; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 9 | 0 | my $ref = shift; | |||||||||||||||||||
| 10 | 0 | ▶ | my $class = ref( $ref ) || $ref; | ||||||||||||||||||
|
Condition0%0/3
ref $ref || $ref
MC/DC0%0/2
ref $ref || $ref
ref $ref
$ref
Truth table0%0/3
A || B
A= ref $refB= $ref
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | my $self = bless { | |||||||||||||||||||
| 13 | lwp => new LWP::UserAgent( cookie_jar => {} ), | ||||||||||||||||||||
| 14 | alias => undef, | ||||||||||||||||||||
| 15 | @_ | ||||||||||||||||||||
| 16 | }, $class; | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 0 | ▶ | die "DVDProfiler requires an alias." unless ( $self->{alias} ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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 | 0 | ▶ | sub getAll { | ||||||||||||||||||
|
Subroutine
getAll: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 27 | 0 | return $_[0]->getList( 'A' ); | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | ▶ | sub getOwned { | ||||||||||||||||||
|
Subroutine
getOwned: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 31 | 0 | return $_[0]->getList( 'O' ); | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | ▶ | sub getOrdered { | ||||||||||||||||||
|
Subroutine
getOrdered: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 35 | 0 | return $_[0]->getList( 'P' ); | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | ▶ | sub getWishlist { | ||||||||||||||||||
|
Subroutine
getWishlist: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 39 | 0 | return $_[0]->getList( 'W' ); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | ▶ | sub getList { | ||||||||||||||||||
|
Subroutine
getList: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 43 | 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 ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | 0 | push( @upcs, new Net::DVDProfiler::DVD( upc => $1, title => $2 ) ); | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 0 | return @upcs; | |||||||||||||||||||
| 53 | } | ||||||||||||||||||||
| 54 | 1 | 1; | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||