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 user info |
||
57 | * If username param is not specified, will |
||
58 | * return info for logged user |
||
59 | * |
||
60 | * @param string $username |
||
61 | * @return null|array |
||
62 | */ |
||
63 | public function info($username) |
||
69 | |||
70 | /** |
||
71 | * Get pinner followers |
||
72 | * |
||
73 | * @param string $username |
||
74 | * @param int $batchesLimit |
||
75 | * @return Iterator |
||
76 | */ |
||
77 | public function followers($username, $batchesLimit = 0) |
||
83 | |||
84 | /** |
||
85 | * Get pinner following other pinners |
||
86 | * |
||
87 | * @param string $username |
||
88 | * @param int $batchesLimit |
||
89 | * @return Iterator |
||
90 | */ |
||
91 | public function following($username, $batchesLimit = 0) |
||
97 | |||
98 | /** |
||
99 | * Get pinner pins |
||
100 | * |
||
101 | * @param string $username |
||
102 | * @param int $batchesLimit |
||
103 | * @return Iterator |
||
104 | */ |
||
105 | public function pins($username, $batchesLimit = 0) |
||
111 | |||
112 | /** |
||
113 | * Login as pinner |
||
114 | * |
||
115 | * @param $username |
||
116 | * @param $password |
||
117 | * @return bool |
||
118 | */ |
||
119 | public function login($username, $password) |
||
138 | |||
139 | /** |
||
140 | * Validates password and login |
||
141 | * @param string $username |
||
142 | * @param string $password |
||
143 | */ |
||
144 | protected function _checkCredentials($username, $password) |
||
150 | |||
151 | /** |
||
152 | * Search scope |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | protected function getScope() |
||
160 | |||
161 | |||
162 | protected function getEntityIdName() |
||
166 | |||
167 | /** |
||
168 | * Follow resource |
||
169 | * |
||
170 | * @return string |
||
171 | */ |
||
172 | protected function getFollowUrl() |
||
176 | |||
177 | /** |
||
178 | * UnFollow resource |
||
179 | * @return string |
||
180 | */ |
||
181 | protected function getUnfFollowUrl() |
||
185 | } |
||
186 |