| 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; |