| @@ 200-208 (lines=9) @@ | ||
| 197 | * @param int $limit |
|
| 198 | * @return Iterator |
|
| 199 | */ |
|
| 200 | public function fromSource($source, $limit = 0) |
|
| 201 | { |
|
| 202 | $params = [ |
|
| 203 | 'data' => ['domain' => $source], |
|
| 204 | 'url' => UrlBuilder::RESOURCE_DOMAIN_FEED, |
|
| 205 | ]; |
|
| 206 | ||
| 207 | return $this->getPaginatedResponse($params, $limit); |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * Get the latest pin activity with pagination. |
|
| @@ 237-245 (lines=9) @@ | ||
| 234 | * @param int $limit |
|
| 235 | * @return Iterator |
|
| 236 | */ |
|
| 237 | public function userFeed($limit = 0) |
|
| 238 | { |
|
| 239 | $params = [ |
|
| 240 | 'data' => [], |
|
| 241 | 'url' => UrlBuilder::RESOURCE_USER_FEED |
|
| 242 | ]; |
|
| 243 | ||
| 244 | return $this->getPaginatedResponse($params, $limit); |
|
| 245 | } |
|
| 246 | ||
| 247 | /** |
|
| 248 | * @param int $pinId |
|
| @@ 252-260 (lines=9) @@ | ||
| 249 | * @param int $limit |
|
| 250 | * @return mixed |
|
| 251 | */ |
|
| 252 | public function getRelatedPins($pinId, $limit = 0) |
|
| 253 | { |
|
| 254 | $params = [ |
|
| 255 | 'data' => ['pin' => $pinId], |
|
| 256 | 'url' => UrlBuilder::RESOURCE_RELATED_PINS |
|
| 257 | ]; |
|
| 258 | ||
| 259 | return $this->getPaginatedResponse($params, $limit); |
|
| 260 | } |
|
| 261 | ||
| 262 | /** |
|
| 263 | * Calls Pinterest API to like or unlike Pin by ID. |
|
| @@ 30-38 (lines=9) @@ | ||
| 27 | * @param int $limit |
|
| 28 | * @return mixed |
|
| 29 | */ |
|
| 30 | public function all($limit = 0) |
|
| 31 | { |
|
| 32 | $params = [ |
|
| 33 | 'data' => ['allow_stale' => true], |
|
| 34 | 'url' => UrlBuilder::RESOURCE_GET_LATEST_NEWS |
|
| 35 | ]; |
|
| 36 | ||
| 37 | return $this->getPaginatedResponse($params, $limit); |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||