line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
455
|
use parent 'Dancer2::Plugin::Auth::OAuth::Provider'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
5
|
|
|
|
|
|
|
use HTTP::Request::Common; |
6
|
1
|
|
|
1
|
|
53
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
260
|
|
7
|
|
|
|
|
|
|
version => '1.001', # 1.0a |
8
|
|
|
|
|
|
|
urls => { |
9
|
3
|
|
|
3
|
0
|
31
|
access_token_url => 'https://twitter.com/oauth/access_token', |
10
|
|
|
|
|
|
|
authorize_url => 'https://twitter.com/oauth/authorize', |
11
|
|
|
|
|
|
|
request_token_url => 'https://twitter.com/oauth/request_token', |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
} } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ($self, $session) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $session_data = $session->read('oauth'); |
18
|
1
|
|
|
1
|
0
|
3
|
|
19
|
|
|
|
|
|
|
my $request = Net::OAuth->request("protected resource")->new( |
20
|
1
|
|
|
|
|
3
|
$self->_default_args_v1, |
21
|
|
|
|
|
|
|
token => $session_data->{twitter}{access_token}, |
22
|
|
|
|
|
|
|
token_secret => $session_data->{twitter}{access_token_secret}, |
23
|
|
|
|
|
|
|
request_method => 'GET', |
24
|
|
|
|
|
|
|
request_url => 'https://api.twitter.com/1.1/account/verify_credentials.json', |
25
|
|
|
|
|
|
|
); |
26
|
1
|
|
|
|
|
23
|
$request->sign; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $resp = $self->ua->request(GET $request->to_url); |
29
|
1
|
|
|
|
|
555
|
if ($resp->is_success) { |
30
|
|
|
|
|
|
|
my $user = $self->_stringify_json_booleans( |
31
|
1
|
|
|
|
|
1112
|
JSON::MaybeXS::decode_json( $resp->decoded_content ) |
32
|
1
|
50
|
|
|
|
1254
|
); |
33
|
1
|
|
|
|
|
13
|
$session_data->{twitter}{user_info} = $user; |
34
|
|
|
|
|
|
|
$session->write('oauth', $session_data); |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
4
|
} |
37
|
1
|
|
|
|
|
4
|
|
38
|
|
|
|
|
|
|
1; |