Bolandish / PHP-Instagram-Grabber

A workaround for the new Instagram policy to get images by hashtag and user id. No need for accesstoken :)
150 stars 39 forks source link

Error #26

Open nagualcode opened 7 years ago

nagualcode commented 7 years ago

Hello, my goal is to get URLs of photos of a given hashtag, with username and like counts. Here is what I am doing: `<?php require_once DIR . '/vendor/autoload.php'; $media = Bolandish\Instagram::getMediaByHashtag(ahashtag, 58); foreach($media as $value){ if ($value->dimensions->width === $value->dimensions->height){ echo $value->likes->count. ("\n"). $value->owner->username. ("\n"). $value->thumbnail_src. ("\n");

} } `

But I get:

PHP Notice: Trying to get property of non-object in /mnt/memory/moods/app/insta/api/src/Instagram.php on line 55 PHP Notice: Trying to get property of non-object in /mnt/memory/moods/app/insta/api/src/Instagram.php on line 55 PHP Warning: Invalid argument supplied for foreach()

Any help?

Bolandish commented 7 years ago

@fredericofs Which version are you using? If you are using version < 1.0.10 please update it to .10 version :)

nagualcode commented 7 years ago

last version. I found that the example.php wors on my osx machine. And fails of my raspbian jessy machine (where it used to work until last week). update from github on both. Installed lastest composer too on both.

Bolandish commented 7 years ago

please send me a json_encoded dump of $media :)