pgrimaud/instagram-user-feed

gives issue syntex error

kashif-sol opened this issue · 8 comments

Version(s) affected: 16

image

anyone here using package and face these issues

Hello,
I have the same

i stumbeld upon this also, while trying to get a user profile

$api->getProfile($username);

the error is thrown in

throw new InstagramFetchException('Error: ' . $e->getMessage());

the Problem is in
$res = $this->client->request('GET', $endpoint, $headers);
CacheResponse::setResponse($res);
$data = (string)$res->getBody();
$data = json_decode($data);
if ($data === null) {
throw new InstagramFetchException(json_last_error_msg());
}

instagram is giving an html file back
so the json couldnt be decoded ( Syntax Error )

but i couldn't determine what the real problem is. i couldnt find an error in the html response

on my local application (different ip) i dont have the problem

// EDIT: copying the cache file of my local application to the online application solved it for me (temporary)

Possible pb with permissions on server and files can not be generated?

Possible pb with permissions on server and files can not be generated?

nope, its a problem with instagram, since its giving a html file back instead of a json.
seems my local cache file has the proper cookies set

i think problem is Instagram ask for login

Still the same pb.
Method getProfile() returns code 200 with some html as datas (probably the instagram login page) causing a Syntax error in json_decode().

There are many issues opened for the same error :
#318
#291
#298

I am facing the same issue, Please someone help with this issue