line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
2
|
1
|
|
|
1
|
|
5
|
use Mojo::Weixin::Const qw(%KEY_MAP_FRIEND); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
358
|
|
3
|
|
|
|
|
|
|
sub Mojo::Weixin::_webwxbatchgetcontact_friend{ |
4
|
0
|
|
|
0
|
|
|
my $self = shift; |
5
|
0
|
|
|
|
|
|
my @ids = @_; |
6
|
0
|
|
|
|
|
|
my @return; |
7
|
0
|
|
|
|
|
|
my $api = "https://".$self->domain . "/cgi-bin/mmwebwx-bin/webwxbatchgetcontact"; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
while( my @id = splice(@ids,0,50) ){ |
10
|
0
|
|
|
|
|
|
my @query_string = ( |
11
|
|
|
|
|
|
|
type => "ex", |
12
|
|
|
|
|
|
|
r => $self->now(), |
13
|
|
|
|
|
|
|
); |
14
|
0
|
0
|
|
|
|
|
push @query_string,(pass_ticket => $self->pass_ticket) if $self->pass_ticket; |
15
|
|
|
|
|
|
|
my $post = { |
16
|
|
|
|
|
|
|
BaseRequest => { |
17
|
|
|
|
|
|
|
Uin => $self->wxuin, |
18
|
|
|
|
|
|
|
DeviceID => $self->deviceid, |
19
|
|
|
|
|
|
|
Sid => $self->wxsid, |
20
|
|
|
|
|
|
|
Skey => $self->skey, |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
Count => @id+0, |
23
|
0
|
|
|
|
|
|
List => [ map { {UserName=>$_,EncryChatRoomId=>""} } @id ], |
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
}; |
25
|
0
|
|
|
|
|
|
my $json = $self->http_post($self->gen_url2($api,@query_string),{Referer=>'https://'.$self->domain . '/',json=>1},json=>$post); |
26
|
0
|
0
|
|
|
|
|
next unless defined $json; |
27
|
0
|
0
|
|
|
|
|
next if $json->{BaseResponse}{Ret}!=0; |
28
|
0
|
|
|
|
|
|
for my $e (@{$json->{ContactList}}){ |
|
0
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $friend = {}; |
30
|
0
|
|
|
|
|
|
for(keys %KEY_MAP_FRIEND){ |
31
|
0
|
|
0
|
|
|
|
$friend->{$_} = $e->{$KEY_MAP_FRIEND{$_}} // ""; |
32
|
|
|
|
|
|
|
} |
33
|
0
|
|
|
|
|
|
$friend->{sex} = $self->code2sex($friend->{sex}); |
34
|
0
|
|
|
|
|
|
push @return,$friend; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |
38
|
0
|
0
|
|
|
|
|
return if @return ==0; |
39
|
0
|
0
|
|
|
|
|
return wantarray?@return:$return[0]; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |