diff --git a/src/Codefog/Instagram/EventListener/ModuleListener.php b/src/Codefog/Instagram/EventListener/ModuleListener.php index 70ebab1..17170f5 100644 --- a/src/Codefog/Instagram/EventListener/ModuleListener.php +++ b/src/Codefog/Instagram/EventListener/ModuleListener.php @@ -126,7 +126,7 @@ private function requestAccessToken($clientId) 'client_id' => $clientId, 'redirect_uri' => $_SESSION['CFG_INSTAGRAM_URI'], 'response_type' => 'code', - 'scope' => 'public_content', + 'scope' => 'basic', ]; Controller::redirect('https://api.instagram.com/oauth/authorize/?' . http_build_query($data)); diff --git a/src/Codefog/Instagram/FrontendModule/InstagramModule.php b/src/Codefog/Instagram/FrontendModule/InstagramModule.php index 48c3e6e..03b14fc 100644 --- a/src/Codefog/Instagram/FrontendModule/InstagramModule.php +++ b/src/Codefog/Instagram/FrontendModule/InstagramModule.php @@ -132,7 +132,14 @@ protected function getFeedItems() return []; } - $response = $this->sendRequest($endpoint, ['count' => $this->numberOfItems]); + $options = []; + + // Set the limit only if greater than zero (#10) + if ($this->numberOfItems > 0) { + $options['count'] = $this->numberOfItems; + } + + $response = $this->sendRequest($endpoint, $options); if ($response === null) { return [];