Cmdline/Spotify.pm

filter: Statementstmt 72.2% 13 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 65.3% 17 / 26 CC 1 SCAR 2.9
CC
1
Cov
72%
site
2.0
token_refresh_authorization_header
2.0
BEGIN
1.0
CRAP 1.3
« Cmdline/Youtube.pm ↑ Summary
1 ###########################################
2 package OAuth::Cmdline::Spotify;
3 ###########################################
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use base qw( OAuth::Cmdline );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 ###########################################
11 sub site {
12 ###########################################
13 0 ▶ return "spotify";
Subroutine site: not called CC=1 SCAR=6.9
Pod undocumented
14 }
15  
16 ###########################################
17 sub token_refresh_authorization_header {
18 ###########################################
19 0 ▶ my( $self ) = @_;
Subroutine token_refresh_authorization_header: not called CC=1 SCAR=6.9
Pod undocumented
20  
21 0 my $cache = $self->cache_read();
22  
23 0 my $auth_header =
24 "Basic " .
25 encode_base64(
26 "$cache->{ client_id }:$cache->{ client_secret }",
27 "" # no line break!!
28 );
29 0 return ( "Authorization" => $auth_header );
30 }
31  
32 1 1;
33  
34 __END__
35  
36 =head1 NAME
37  
38 OAuth::Cmdline::Spotify - Spotify-specific OAuth oddities
39  
40 =head1 SYNOPSIS
41  
42 my $oauth = OAuth::Cmdline::Spotify->new( );
43 $oauth->access_token();
44  
45 =head1 DESCRIPTION
46  
47 This class overrides methods of C<OAuth::Cmdline> to comply with
48 Spotify's Web API.
49  
50 =head1 LEGALESE
51  
52 Copyright 2014 by Mike Schilli, all rights reserved.
53 This program is free software, you can redistribute it and/or
54 modify it under the same terms as Perl itself.
55  
56 =head1 AUTHOR
57  
58 2014, Mike Schilli <cpan@perlmeister.com>
« Cmdline/Youtube.pm ↑ Summary