line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
2
|
1
|
|
|
1
|
|
4
|
use Mojo::Weixin::Const qw(%KEY_MAP_USER %KEY_MAP_GROUP %KEY_MAP_GROUP_MEMBER %KEY_MAP_FRIEND); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
401
|
|
3
|
|
|
|
|
|
|
sub Mojo::Weixin::_webwxgetcontact { |
4
|
0
|
|
|
0
|
|
|
my $self = shift; |
5
|
0
|
|
|
|
|
|
my $api = "https://".$self->domain . "/cgi-bin/mmwebwx-bin/webwxgetcontact"; |
6
|
0
|
|
|
|
|
|
my $flag = 0; |
7
|
0
|
|
|
|
|
|
my $seq = 0; |
8
|
0
|
|
|
|
|
|
my @friends; |
9
|
|
|
|
|
|
|
my @groups; |
10
|
0
|
|
|
|
|
|
do { |
11
|
0
|
|
|
|
|
|
my @query_string = ( |
12
|
|
|
|
|
|
|
r => $self->now(), |
13
|
|
|
|
|
|
|
seq => $seq, |
14
|
|
|
|
|
|
|
skey => $self->skey, |
15
|
|
|
|
|
|
|
); |
16
|
0
|
0
|
|
|
|
|
push @query_string,(pass_ticket=>$self->url_escape($self->pass_ticket)) if $self->pass_ticket; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $json = $self->http_get($self->gen_url($api,@query_string),{Referer=>'https://'.$self->domain . '/',json=>1}); |
19
|
|
|
|
|
|
|
#return [\@friends,\@groups] if not defined $json; |
20
|
0
|
0
|
|
|
|
|
return if not defined $json; |
21
|
0
|
0
|
|
|
|
|
return if $json->{BaseResponse}{Ret}!=0; |
22
|
0
|
0
|
|
|
|
|
return if $json->{MemberCount} == 0; |
23
|
0
|
0
|
0
|
|
|
|
if ($self->is_update_all_friend and defined $json->{Seq} and $json->{Seq} != 0){#获取的不全,需要继续获取其余部分 |
|
|
|
0
|
|
|
|
|
24
|
0
|
|
|
|
|
|
$flag = 1 ; |
25
|
0
|
|
|
|
|
|
$seq = $json->{Seq}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
else{ |
28
|
0
|
|
|
|
|
|
$flag = 0; |
29
|
|
|
|
|
|
|
} |
30
|
0
|
|
|
|
|
|
for my $e ( @{ $json->{MemberList} } ){ |
|
0
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if($self->is_group_id($e->{UserName})){ |
32
|
0
|
|
|
|
|
|
my $group = {}; |
33
|
0
|
|
|
|
|
|
for(keys %KEY_MAP_GROUP){ |
34
|
0
|
|
0
|
|
|
|
$group->{$_} = $e->{$KEY_MAP_GROUP{$_}} // ""; |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
for my $m (@{$e->{MemberList}}){ |
|
0
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $member = {}; |
38
|
0
|
|
|
|
|
|
for(keys %KEY_MAP_GROUP_MEMBER){ |
39
|
0
|
|
0
|
|
|
|
$member->{$_} = $m->{$KEY_MAP_GROUP_MEMBER{$_}} // ""; |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
$member->{sex} = $self->code2sex($member->{sex}); |
42
|
0
|
|
|
|
|
|
push @{$group->{member}},$member; |
|
0
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
0
|
|
|
|
|
|
push @groups,$group; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
else{ |
47
|
0
|
|
|
|
|
|
my $friend = {}; |
48
|
0
|
|
|
|
|
|
for(keys %KEY_MAP_FRIEND){ |
49
|
0
|
|
0
|
|
|
|
$friend->{$_} = $e->{$KEY_MAP_FRIEND{$_}} // "" ; |
50
|
|
|
|
|
|
|
} |
51
|
0
|
|
|
|
|
|
$friend->{sex} = $self->code2sex($friend->{sex}); |
52
|
0
|
|
|
|
|
|
push @friends,$friend; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} while $flag; |
56
|
0
|
|
|
|
|
|
return [\@friends,\@groups]; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |