Webqq/Client/Method/_get_msg_tip.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 21 CC 3 SCAR 22.5
CC
3
Cov
0%
Webqq::Client::_get_msg_tip
12.0
BEGIN
2.0
CRAP 9.5
1 use Webqq::Client::Util qw(console);
2 sub Webqq::Client::_get_msg_tip{
3 my $self = shift;
4 my $ua = $self->{asyn_ua};
5 my $api_url = 'http://web2.qq.com/web2/get_msg_tip';
6 my @headers = (
7 Referer => 'http://web2.qq.com/webqq.html',
8 'Content-Type' => 'utf-8',
9 );
10 my @query_string = (
11 uin => undef,
12 tp => 1,
13 id => 0,
14 retype => 1,
15 rc => $self->{qq_param}{rc}++,
16 lv => 3,
17 t => time,
18 );
19  
20 my @query_string_pairs;
21 push @query_string_pairs , shift(@query_string) . "=" . shift(@query_string) while(@query_string);
22 print $api_url.'?'.join("&",@query_string_pairs),"\n" if $self->{debug};
23 $ua->get($api_url.'?'.join("&",@query_string_pairs),@headers,sub{
24 my $response = shift;
25 console "心跳检测\n" if $self->{debug};
26 });
27 }
28 1;