| 1 | 1 | ▶ | use Webqq::Client::Util qw(console); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 0 | ▶ | sub Webqq::Client::logout { | ||||||||
|
Subroutine
logout: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||
| 3 | 0 | my $self = shift; | |||||||||
| 4 | 0 | console "正在注销...\n"; | |||||||||
| 5 | 0 | ▶ | if($self->{type} eq 'smartqq'){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 6 | 0 | $self->{cookie_jar}->set_cookie(0,"ptwebqq",undef,"/","qq.com",undef,undef,undef,-1); | |||||||||
| 7 | 0 | $self->{cookie_jar}->set_cookie(0,"skey",undef,"/","qq.com",undef,undef,undef,-1); | |||||||||
| 8 | 0 | console "注销完毕\n"; | |||||||||
| 9 | 0 | return 1; | |||||||||
| 10 | } | ||||||||||
| 11 | 0 | my $ua = $self->{ua}; | |||||||||
| 12 | 0 | my $api_url = 'http://d.web2.qq.com/channel/logout2'; | |||||||||
| 13 | my @query_string = ( | ||||||||||
| 14 | ids => undef, | ||||||||||
| 15 | clientid => $self->{qq_param}{clientid}, | ||||||||||
| 16 | psessionid => $self->{qq_param}{psessionid}, | ||||||||||
| 17 | 0 | t => time, | |||||||||
| 18 | ); | ||||||||||
| 19 | 0 | my @headers = (Referer => 'http://d.web2.qq.com/proxy.html?v=20110331002&callback=1&id=3'); | |||||||||
| 20 | 0 | my @query_string_pairs; | |||||||||
| 21 | 0 | ▶ | push @query_string_pairs , shift(@query_string) . "=" . shift(@query_string) while(@query_string); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | my $response = $ua->get($api_url.'?'.join("&",@query_string_pairs),@headers); | |||||||||
| 23 | 0 | ▶ | if($response->is_success){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | my $content = $response->content(); | |||||||||
| 25 | 0 | ▶ | print $content,"\n" if $self->{debug}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | console "注销完毕\n"; | |||||||||
| 27 | 0 | return 1; | |||||||||
| 28 | } | ||||||||||
| 29 | 0 | else{return 0} | |||||||||
| 30 | } | ||||||||||
| 31 | 1 | 1; | |||||||||