line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Spotify::Search; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
53689
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
120
|
|
4
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
97
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
17
|
use base 'Net::Spotify::Service'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
2413
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub format_request { |
11
|
3
|
|
|
3
|
1
|
5363
|
my ($self, $method, %parameters) = @_; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
|
|
15
|
my $base_url = $self->base_url(); |
14
|
3
|
|
|
|
|
14
|
my $version = $self->version(); |
15
|
3
|
|
|
|
|
12
|
my $format = $self->format(); |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
29
|
my $uri = URI->new("$base_url/search/$version/$method.$format"); |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
11113
|
foreach my $key (qw(q page)) { |
20
|
6
|
100
|
66
|
|
|
607
|
if (exists $parameters{$key} && $parameters{$key}) { |
21
|
5
|
|
|
|
|
29
|
$uri->query_param($key, $parameters{$key}); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
338
|
return HTTP::Request->new('GET', $uri); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |