| 1 | 1 | ▶ | use JSON; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use Webqq::Client::Util qw(code2state code2client); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 0 | ▶ | sub Webqq::Client::_get_user_info{ | ||||||||
|
Subroutine
_get_user_info: not called CC=8 SCAR=42.8
| |||||||||||
| 4 | 0 | my $self = shift; | |||||||||
| 5 | 0 | my $webqq_api_url ='http://s.web2.qq.com/api/get_friend_info2'; | |||||||||
| 6 | 0 | my $smartqq_api_url ='http://s.web2.qq.com/api/get_self_info2'; | |||||||||
| 7 | 0 | ▶ | my $api_url = $self->{type} eq 'webqq'? $webqq_api_url | ||||||||
|
Branch: 1 branch
| |||||||||||
| 8 | : $smartqq_api_url | ||||||||||
| 9 | ; | ||||||||||
| 10 | 0 | my $ua = $self->{ua}; | |||||||||
| 11 | 0 | ▶ | my @headers = $self->{type} eq 'webqq'? (Referer=>'http://s.web2.qq.com/proxy.html?v=20110412001&callback=1&id=3') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | : (Referer=>'http://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1'); | ||||||||||
| 13 | ; | ||||||||||
| 14 | |||||||||||
| 15 | 0 | my @query_string = ( | |||||||||
| 16 | t => time, | ||||||||||
| 17 | ); | ||||||||||
| 18 | 0 | ▶ | if($self->{type} eq 'webqq'){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | unshift @query_string,( | ||||||||||
| 20 | tuin => $self->{qq_param}{qq}, | ||||||||||
| 21 | verifysession => undef, | ||||||||||
| 22 | code => undef, | ||||||||||
| 23 | vfwebqq => $self->{qq_param}{vfwebqq}, | ||||||||||
| 24 | vfwebqq => $self->{qq_param}{vfwebqq} | ||||||||||
| 25 | 0 | ); | |||||||||
| 26 | } | ||||||||||
| 27 | 0 | my @query_string_pairs; | |||||||||
| 28 | 0 | ▶ | push @query_string_pairs , shift(@query_string) . "=" . shift(@query_string) while(@query_string); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | my $response = $ua->get($api_url.'?'.join("&",@query_string_pairs),@headers); | |||||||||
| 30 | 0 | ▶ | if($response->is_success){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | ▶ | print $response->content(),"\n" if $self->{debug}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | my $json = JSON->new->utf8->decode( $response->content() ); | |||||||||
| 33 | 0 | ▶ | return undef if $json->{retcode} !=0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 0 | $json->{result}{state} = $self->{qq_param}{state}; | |||||||||
| 35 | 0 | $json->{result}{client_type} = 'web'; | |||||||||
| 36 | 0 | return $json->{result}; | |||||||||
| 37 | } | ||||||||||
| 38 | 0 | else{return undef} | |||||||||
| 39 | } | ||||||||||
| 40 | 1 | 1; | |||||||||