1 | <?php |
||
15 | class Pinners extends Provider |
||
16 | { |
||
17 | use SearchTrait, FollowTrait, FollowersTrait; |
||
18 | |||
19 | /** |
||
20 | * Get different user data, for example, followers, following, pins. |
||
21 | * Collects data while paginating with bookmarks through pinterest results. |
||
22 | * Return array. Key data - for results and key bookmarks - for pagination. |
||
23 | * |
||
24 | * @param string $username |
||
25 | * @param string $url |
||
26 | * @param string $sourceUrl |
||
27 | * @param array $bookmarks |
||
28 | * @return array |
||
29 | */ |
||
30 | public function getUserData($username, $url, $sourceUrl, $bookmarks = []) |
||
39 | |||
40 | /** |
||
41 | * Get user info |
||
42 | * If username param is not specified, will |
||
43 | * return info for logged user |
||
44 | * |
||
45 | * @param string $username |
||
46 | * @return null|array |
||
47 | */ |
||
48 | public function info($username) |
||
54 | |||
55 | /** |
||
56 | * Get pinner followers |
||
57 | * |
||
58 | * @param string $username |
||
59 | * @param int $batchesLimit |
||
60 | * @return Iterator |
||
61 | */ |
||
62 | public function followers($username, $batchesLimit = 0) |
||
68 | |||
69 | /** |
||
70 | * Get pinner following other pinners |
||
71 | * |
||
72 | * @param string $username |
||
73 | * @param int $batchesLimit |
||
74 | * @return Iterator |
||
75 | */ |
||
76 | public function following($username, $batchesLimit = 0) |
||
82 | |||
83 | /** |
||
84 | * Get pinner pins |
||
85 | * |
||
86 | * @param string $username |
||
87 | * @param int $batchesLimit |
||
88 | * @return Iterator |
||
89 | */ |
||
90 | public function pins($username, $batchesLimit = 0) |
||
96 | |||
97 | /** |
||
98 | * Login as pinner |
||
99 | * |
||
100 | * @param string $username |
||
101 | * @param string $password |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function login($username, $password) |
||
122 | |||
123 | /** |
||
124 | * Validates password and login |
||
125 | * @param string $username |
||
126 | * @param string $password |
||
127 | */ |
||
128 | protected function _checkCredentials($username, $password) |
||
134 | |||
135 | /** |
||
136 | * Search scope |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | protected function getScope() |
||
144 | |||
145 | protected function getEntityIdName() |
||
149 | |||
150 | /** |
||
151 | * Follow resource |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | protected function getFollowUrl() |
||
159 | |||
160 | /** |
||
161 | * UnFollow resource |
||
162 | * @return string |
||
163 | */ |
||
164 | protected function getUnfFollowUrl() |
||
168 | |||
169 | /** |
||
170 | * @param string $username |
||
171 | * @param string $url |
||
172 | * @param string $sourceUrl |
||
173 | * @param integer $batchesLimit |
||
174 | * @return Iterator |
||
175 | */ |
||
176 | protected function getPaginatedData($username, $url, $sourceUrl, $batchesLimit) |
||
186 | } |
||
187 |