line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################### |
2
|
|
|
|
|
|
|
package OAuth::Cmdline::Spotify; |
3
|
|
|
|
|
|
|
########################################### |
4
|
1
|
|
|
1
|
|
82940
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
6
|
1
|
|
|
1
|
|
311
|
use MIME::Base64; |
|
1
|
|
|
|
|
487
|
|
|
1
|
|
|
|
|
52
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use base qw( OAuth::Cmdline ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
353
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.07'; # VERSION |
11
|
|
|
|
|
|
|
# ABSTRACT: Spotify-specific OAuth oddities |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
########################################### |
14
|
|
|
|
|
|
|
sub site { |
15
|
|
|
|
|
|
|
########################################### |
16
|
0
|
|
|
0
|
0
|
|
return "spotify"; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
########################################### |
20
|
|
|
|
|
|
|
sub token_refresh_authorization_header { |
21
|
|
|
|
|
|
|
########################################### |
22
|
0
|
|
|
0
|
0
|
|
my( $self ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $cache = $self->cache_read(); |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $auth_header = |
27
|
|
|
|
|
|
|
"Basic " . |
28
|
|
|
|
|
|
|
encode_base64( |
29
|
|
|
|
|
|
|
"$cache->{ client_id }:$cache->{ client_secret }", |
30
|
|
|
|
|
|
|
"" # no line break!! |
31
|
|
|
|
|
|
|
); |
32
|
0
|
|
|
|
|
|
return ( "Authorization" => $auth_header ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
OAuth::Cmdline::Spotify - Spotify-specific OAuth oddities |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 0.07 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $oauth = OAuth::Cmdline::Spotify->new( ); |
54
|
|
|
|
|
|
|
$oauth->access_token(); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 DESCRIPTION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
This class overrides methods of C<OAuth::Cmdline> to comply with |
59
|
|
|
|
|
|
|
Spotify's Web API. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Mike Schilli <cpan@perlmeister.com> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Mike Schilli. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
70
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |