| 1 | package XML::Amazon::Item; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use LWP::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | ▶ | use XML::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 4 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | sub new { | ||||||||||
| 11 | 0 | ▶ | my($pkg, %options) = @_; | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 12 | |||||||||||
| 13 | bless { | ||||||||||
| 14 | title => $options{'title'}, | ||||||||||
| 15 | authors => $options{'authors'}, | ||||||||||
| 16 | artists => $options{'artists'}, | ||||||||||
| 17 | creators => $options{'creators'}, | ||||||||||
| 18 | directors => $options{'directors'}, | ||||||||||
| 19 | actors => $options{'actors'}, | ||||||||||
| 20 | type => $options{'type'}, | ||||||||||
| 21 | url => $options{'url'}, | ||||||||||
| 22 | smallimage => $options{'smallimage'}, | ||||||||||
| 23 | mediumimage => $options{'mediumimage'}, | ||||||||||
| 24 | largeimage => $options{'largeimage'}, | ||||||||||
| 25 | publisher => $options{'publisher'}, | ||||||||||
| 26 | 0 | price => $options{'price'}, | |||||||||
| 27 | }, $pkg; | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | sub creators_all { | ||||||||||
| 31 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
creators_all: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 32 | 0 | my @list; | |||||||||
| 33 | 0 | ▶ | for (my $i; $self->{authors}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 0 | push @list, $self->{authors}->[$i]; | |||||||||
| 35 | } | ||||||||||
| 36 | 0 | ▶ | for (my $i; $self->{artists}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | push @list, $self->{artists}->[$i]; | |||||||||
| 38 | } | ||||||||||
| 39 | 0 | ▶ | for (my $i; $self->{creators}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | push @list, $self->{creators}->[$i]; | |||||||||
| 41 | } | ||||||||||
| 42 | 0 | return @list; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | sub made_by { | ||||||||||
| 46 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
made_by: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 47 | 0 | my @list; | |||||||||
| 48 | 0 | ▶ | for (my $i; $self->{authors}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 0 | push @list, $self->{authors}->[$i]; | |||||||||
| 50 | } | ||||||||||
| 51 | 0 | ▶ | for (my $i; $self->{artists}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | 0 | push @list, $self->{artists}->[$i]; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 0 | ▶ | for (my $i; $self->{creators}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | 0 | push @list, $self->{creators}->[$i]; | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 0 | ▶ | for (my $i; $self->{directors}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | 0 | push @list, $self->{directors}->[$i]; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 0 | ▶ | for (my $i; $self->{actors}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | 0 | push @list, $self->{actors}->[$i]; | |||||||||
| 65 | } | ||||||||||
| 66 | |||||||||||
| 67 | |||||||||||
| 68 | 0 | my %tmp; | |||||||||
| 69 | 0 | @list = grep( !$tmp{$_}++, @list ); | |||||||||
| 70 | |||||||||||
| 71 | 0 | return @list; | |||||||||
| 72 | } | ||||||||||
| 73 | |||||||||||
| 74 | sub authors { | ||||||||||
| 75 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
authors: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 76 | 0 | my @list; | |||||||||
| 77 | 0 | ▶ | for (my $i; $self->{authors}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 78 | 0 | push @list, $self->{authors}->[$i]; | |||||||||
| 79 | } | ||||||||||
| 80 | 0 | return @list; | |||||||||
| 81 | } | ||||||||||
| 82 | |||||||||||
| 83 | sub artists { | ||||||||||
| 84 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
artists: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 85 | 0 | my @list; | |||||||||
| 86 | 0 | ▶ | for (my $i; $self->{artists}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 87 | 0 | push @list, $self->{artists}->[$i]; | |||||||||
| 88 | } | ||||||||||
| 89 | 0 | return @list; | |||||||||
| 90 | } | ||||||||||
| 91 | |||||||||||
| 92 | sub creators { | ||||||||||
| 93 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
creators: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 94 | 0 | my @list; | |||||||||
| 95 | 0 | ▶ | for (my $i; $self->{creators}->[$i]; $i++){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 96 | 0 | push @list, $self->{creators}->[$i]; | |||||||||
| 97 | } | ||||||||||
| 98 | 0 | return @list; | |||||||||
| 99 | } | ||||||||||
| 100 | |||||||||||
| 101 | sub publisher { | ||||||||||
| 102 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
publisher: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 103 | 0 | return $self->{publisher}; | |||||||||
| 104 | } | ||||||||||
| 105 | |||||||||||
| 106 | sub asin { | ||||||||||
| 107 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
asin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 108 | 0 | return $self->{asin}; | |||||||||
| 109 | } | ||||||||||
| 110 | |||||||||||
| 111 | sub title { | ||||||||||
| 112 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
title: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 113 | 0 | return $self->{title}; | |||||||||
| 114 | } | ||||||||||
| 115 | |||||||||||
| 116 | sub author { | ||||||||||
| 117 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
author: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 118 | 0 | return @{$self->authors}[0]; | |||||||||
| 119 | } | ||||||||||
| 120 | |||||||||||
| 121 | sub image { | ||||||||||
| 122 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
image: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 123 | 0 | my $size = shift; | |||||||||
| 124 | |||||||||||
| 125 | 0 | ▶ | return $self->{smallimage} if $size eq 's'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 126 | 0 | ▶ | return $self->{mediumimage} if $size eq 'm'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 127 | 0 | ▶ | return $self->{largeimage} if $size eq 'l'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 128 | |||||||||||
| 129 | } | ||||||||||
| 130 | |||||||||||
| 131 | sub url { | ||||||||||
| 132 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
url: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 133 | 0 | return $self->{url}; | |||||||||
| 134 | } | ||||||||||
| 135 | |||||||||||
| 136 | sub type { | ||||||||||
| 137 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 138 | 0 | return $self->{type}; | |||||||||
| 139 | } | ||||||||||
| 140 | |||||||||||
| 141 | sub price { | ||||||||||
| 142 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
price: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 143 | 0 | return $self->{price}; | |||||||||
| 144 | } | ||||||||||
| 145 | |||||||||||
| 146 | 4 | 1; | |||||||||
| 147 | |||||||||||
| 148 | __END__ | ||||||||||