1 | <?php |
||
12 | class Pinners extends Provider |
||
13 | { |
||
14 | use SearchTrait, FollowTrait; |
||
15 | |||
16 | /** |
||
17 | * Get different user data, for example, followers, following, pins. |
||
18 | * Collects data while paginating with bookmarks through pinterest results. |
||
19 | * Return array. Key data - for results and key bookmarks - for pagination. |
||
20 | * |
||
21 | * @param string $username |
||
22 | * @param string $url |
||
23 | * @param string $sourceUrl |
||
24 | * @param array $bookmarks |
||
25 | * @return array |
||
26 | */ |
||
27 | public function getUserData($username, $url, $sourceUrl, $bookmarks = []) |
||
35 | |||
36 | /** |
||
37 | * @param string $username |
||
38 | * @param string $resourceUrl |
||
39 | * @param string $sourceUrl |
||
40 | * @param int $batchesLimit |
||
41 | * @return \Iterator |
||
42 | */ |
||
43 | public function getPaginatedUserData($username, $resourceUrl, $sourceUrl, $batchesLimit = 0) |
||
53 | |||
54 | /** |
||
55 | * Get the logged-in account username |
||
56 | * |
||
57 | * @return array|null |
||
58 | */ |
||
59 | public function myAccountName() |
||
66 | |||
67 | /** |
||
68 | * Get user info |
||
69 | * If username param is not specified, will |
||
70 | * return info for logged user |
||
71 | * |
||
72 | * @param string $username |
||
73 | * @return null|array |
||
74 | */ |
||
75 | public function info($username) |
||
81 | |||
82 | /** |
||
83 | * Get pinner followers |
||
84 | * |
||
85 | * @param string $username |
||
86 | * @param int $batchesLimit |
||
87 | * @return \Iterator |
||
88 | */ |
||
89 | public function followers($username, $batchesLimit = 0) |
||
95 | |||
96 | /** |
||
97 | * Get pinner following other pinners |
||
98 | * |
||
99 | * @param string $username |
||
100 | * @param int $batchesLimit |
||
101 | * @return \Iterator |
||
102 | */ |
||
103 | public function following($username, $batchesLimit = 0) |
||
109 | |||
110 | /** |
||
111 | * Get pinner pins |
||
112 | * |
||
113 | * @param string $username |
||
114 | * @param int $batchesLimit |
||
115 | * @return \Iterator |
||
116 | */ |
||
117 | public function pins($username, $batchesLimit = 0) |
||
123 | |||
124 | /** |
||
125 | * Login as pinner |
||
126 | * |
||
127 | * @param $username |
||
128 | * @param $password |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function login($username, $password) |
||
149 | |||
150 | /** |
||
151 | * Validates password and login |
||
152 | * @param string $username |
||
153 | * @param string $password |
||
154 | */ |
||
155 | protected function _checkCredentials($username, $password) |
||
161 | |||
162 | /** |
||
163 | * Search scope |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | protected function getScope() |
||
171 | |||
172 | |||
173 | protected function getEntityIdName() |
||
177 | |||
178 | /** |
||
179 | * Follow resource |
||
180 | * |
||
181 | * @return string |
||
182 | */ |
||
183 | protected function getFollowUrl() |
||
187 | |||
188 | /** |
||
189 | * UnFollow resource |
||
190 | * @return string |
||
191 | */ |
||
192 | protected function getUnfFollowUrl() |
||
196 | } |
||
197 |