line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
831
|
use parent 'Dancer2::Plugin::Auth::OAuth::Provider'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
4
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
5
|
|
|
|
|
|
|
use HTTP::Request::Common; |
6
|
1
|
|
|
1
|
|
68
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
398
|
|
7
|
|
|
|
|
|
|
version => '1.001', # 1.0a |
8
|
|
|
|
|
|
|
urls => { |
9
|
3
|
|
|
3
|
0
|
59
|
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
|
4
|
|
19
|
|
|
|
|
|
|
my $request = Net::OAuth->request("protected resource")->new( |
20
|
1
|
|
|
|
|
5
|
$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
|
|
|
|
|
29
|
$request->sign; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $resp = $self->ua->request(GET $request->to_url); |
29
|
1
|
|
|
|
|
781
|
if ($resp->is_success) { |
30
|
|
|
|
|
|
|
my $user = $self->_stringify_json_booleans( |
31
|
1
|
|
|
|
|
1390
|
JSON::MaybeXS::decode_json( $resp->decoded_content ) |
32
|
1
|
50
|
|
|
|
1583
|
); |
33
|
1
|
|
|
|
|
24
|
$session_data->{twitter}{user_info} = $user; |
34
|
|
|
|
|
|
|
$session->write('oauth', $session_data); |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
5
|
} |
37
|
1
|
|
|
|
|
9
|
|
38
|
|
|
|
|
|
|
1; |