Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

getUserFollows() now with the cursor param to paginate results #9

Merged
merged 2 commits into from

2 participants

@danielcosta

The user_follows method doesn't returns all "follows", now the API accepts the cursor param to paginate through the API result.

@macuenca macuenca merged commit b27b368 into macuenca:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 Instagram.php
View
7 Instagram.php
@@ -38,7 +38,7 @@ class Instagram {
'user_feed' => 'https://api.instagram.com/v1/users/self/feed?%s',
'user_recent' => 'https://api.instagram.com/v1/users/%s/media/recent/?access_token=%s&max_id=%s&min_id=%s&max_timestamp=%s&min_timestamp=%s',
'user_search' => 'https://api.instagram.com/v1/users/search?q=%s&access_token=%s',
- 'user_follows' => 'https://api.instagram.com/v1/users/%d/follows?access_token=%s',
+ 'user_follows' => 'https://api.instagram.com/v1/users/%d/follows?access_token=%s&cursor=%s',
'user_followed_by' => 'https://api.instagram.com/v1/users/%d/followed-by?access_token=%s',
'user_requested_by' => 'https://api.instagram.com/v1/users/self/requested-by?access_token=%s',
'user_relationship' => 'https://api.instagram.com/v1/users/%d/relationship?access_token=%s',
@@ -265,9 +265,10 @@ public function searchUser($name) {
/**
* Get the list of users this user follows.
* @param integer $id. The user id
+ * @param integer $cursor. Cursor to paginate results
*/
- public function getUserFollows($id) {
- $endpointUrl = sprintf($this->_endpointUrls['user_follows'], $id, $this->getAccessToken());
+ public function getUserFollows($id, $cursor = '') {
+ $endpointUrl = sprintf($this->_endpointUrls['user_follows'], $id, $this->getAccessToken(), $cursor);
$this->_initHttpClient($endpointUrl);
return $this->_getHttpClientResponse();
}
Something went wrong with that request. Please try again.