Instagram-PHP-API
Instagram-PHP-API copied to clipboard
getTagMedia fails because of default hardcoded 0 value in arg
the getTagMedia function has a hardcoded limit of 0 by default. This causes an error when the function is called. Suggestion is to change the argument passed to the function to a value such as $mediaLimit earlier in the code so that it can be manipulated easily in the future.
Thanks for reaching out. This will be fixed when #119 gets merged.
I confirm the problem about getTagMedia function.
getTagMedia() Change $auth to true in _makeCall and check pls other auth methods
https://instagram.com/developer/endpoints/tags/
@imonly Could you please describe a little more why we should change the default $auth
parameter to true? Maybe its better to specify this for each individual request instead. For example; we should add it here: https://github.com/cosenary/Instagram-PHP-API/blob/master/src/Instagram.php#L304
https://github.com/cosenary/Instagram-PHP-API/blob/master/src/Instagram.php#L317 $auth == false but in documentation need access_token : https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
Yeah, we should fix this. Maybe you could create a pull request and fix this for all methods that need the authentication?
Sorry, but I have no time for it And also, it would be nice if you could set up a job with the api so that did not need to reinvent the wheel when you want to Ajax requests to the api, in the comments there is a very sensible idea of passing parameters to the method https://gist.github.com/cosenary/2961185#comment-803467
@imonly Okay. Maybe you could create a second thread concerning the job issue?
Seems like others, #121 and #122, also are experiencing this issue. We need to address this asap.
Like just said in #121
I managed to get my code running with a quick fix like the following
public function getUserFeed($limit = 0) {
if($limit>0) {
return $this->_makeCall('users/self/feed', true, array('count' => $limit));
}else{
return $this->_makeCall('users/self/feed', true);
}
It isn't pretty but it work fine without having to edit the methods call. Instagram now ask for either a count parameter over 0 or no count parameter at all. I figured it was the best way to deal with it will we figure a way to solve it properly.
Is this fix pushed to master? I am still getting this error....