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