line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Foursquare::Users; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
74
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
2045
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
0
|
|
|
0
|
0
|
|
my ($class, $request, $user_id) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
|
|
|
my $self = {}; |
10
|
0
|
|
|
|
|
|
bless $self, $class; |
11
|
0
|
|
|
|
|
|
$self->{request} = $request; |
12
|
0
|
|
0
|
|
|
|
$self->{user_id} = $user_id || 'self'; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub info { |
18
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s", $self->{user_id}; |
21
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# general |
25
|
|
|
|
|
|
|
sub leaderboard { |
26
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $path = 'users/leaderboard'; |
29
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub requests { |
33
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
my $path = 'users/requests'; |
36
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub search { |
40
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $path = 'users/search'; |
43
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ascpects |
47
|
|
|
|
|
|
|
sub badges { |
48
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/badges", $self->{user_id}; |
51
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub checkins { |
55
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/checkins", $self->{user_id}; |
58
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub friends { |
62
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/friends", $self->{user_id}; |
65
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub lists { |
69
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/lists", $self->{user_id}; |
72
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub mayorships { |
76
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/mayorships", $self->{user_id}; |
79
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub photos { |
83
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/photos", $self->{user_id}; |
86
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub venuehistory { |
90
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/venuehistory", $self->{user_id}; |
93
|
0
|
|
|
|
|
|
return $self->{request}->GET($path, \%params); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# actions |
97
|
|
|
|
|
|
|
sub approve { |
98
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/approve", $self->{user_id}; |
101
|
0
|
|
|
|
|
|
return $self->{request}->POST($path, \%params); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub deny { |
105
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/deny", $self->{user_id}; |
108
|
0
|
|
|
|
|
|
return $self->{request}->POST($path, \%params); |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub request { |
112
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/request", $self->{user_id}; |
115
|
0
|
|
|
|
|
|
return $self->{request}->POST($path, \%params); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub setpings { |
119
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/setpings", $self->{user_id}; |
122
|
0
|
|
|
|
|
|
return $self->{request}->POST($path, \%params); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub unfriend { |
126
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/unfriend", $self->{user_id}; |
129
|
0
|
|
|
|
|
|
return $self->{request}->POST($path, \%params); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub update { |
133
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
# change structure for uploading files |
136
|
0
|
0
|
|
|
|
|
if ($params{photo}) { |
137
|
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
my $path = $params{photo}; |
139
|
0
|
|
|
|
|
|
$params{photo} = [ $path ]; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
my $path = sprintf "users/%s/update", $self->{user_id}; |
143
|
0
|
|
|
|
|
|
return $self->{request}->POST($path, \%params); |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; |