1 | <?php |
||
11 | class Pinners extends Provider |
||
12 | { |
||
13 | use SearchHelper, FollowHelper; |
||
14 | |||
15 | /** |
||
16 | * Get different user data, for example, followers, following, pins. |
||
17 | * Collects data while paginating with bookmarks through pinterest results. |
||
18 | * Return array. Key data - for results and key bookmarks - for pagination. |
||
19 | * |
||
20 | * @param string $username |
||
21 | * @param string $url |
||
22 | * @param string $sourceUrl |
||
23 | * @param array $bookmarks |
||
24 | * @return array |
||
25 | */ |
||
26 | public function getUserData($username, $url, $sourceUrl, $bookmarks = []) |
||
34 | |||
35 | /** |
||
36 | * @param string $username |
||
37 | * @param string $resourceUrl |
||
38 | * @param string $sourceUrl |
||
39 | * @param int $batchesLimit |
||
40 | * @return \Iterator |
||
41 | */ |
||
42 | public function getPaginatedUserData($username, $resourceUrl, $sourceUrl, $batchesLimit = 0) |
||
52 | |||
53 | /** |
||
54 | * Get the logged-in account username |
||
55 | * |
||
56 | * @return array|null |
||
57 | */ |
||
58 | public function myAccountName() |
||
65 | |||
66 | /** |
||
67 | * Get user info |
||
68 | * If username param is not specified, will |
||
69 | * return info for logged user |
||
70 | * |
||
71 | * @param string $username |
||
72 | * @return null|array |
||
73 | */ |
||
74 | public function info($username) |
||
80 | |||
81 | /** |
||
82 | * Get pinner followers |
||
83 | * |
||
84 | * @param string $username |
||
85 | * @param int $batchesLimit |
||
86 | * @return \Iterator |
||
87 | */ |
||
88 | public function followers($username, $batchesLimit = 0) |
||
94 | |||
95 | /** |
||
96 | * Get pinner following other pinners |
||
97 | * |
||
98 | * @param string $username |
||
99 | * @param int $batchesLimit |
||
100 | * @return \Iterator |
||
101 | */ |
||
102 | public function following($username, $batchesLimit = 0) |
||
108 | |||
109 | /** |
||
110 | * Get pinner pins |
||
111 | * |
||
112 | * @param string $username |
||
113 | * @param int $batchesLimit |
||
114 | * @return \Iterator |
||
115 | */ |
||
116 | public function pins($username, $batchesLimit = 0) |
||
122 | |||
123 | /** |
||
124 | * Login as pinner |
||
125 | * |
||
126 | * @param $username |
||
127 | * @param $password |
||
128 | * @return bool |
||
129 | */ |
||
130 | public function login($username, $password) |
||
146 | |||
147 | protected function getScope() |
||
151 | |||
152 | protected function getEntityIdName() |
||
156 | |||
157 | protected function getFollowUrl() |
||
161 | |||
162 | protected function getUnfFollowUrl() |
||
166 | } |
||
167 |