Instagram PHP API: getTagMedia only works locally -


i'm working instagram php api (https://github.com/cosenary/instagram-php-api) , have used solution found have been working (see @kexxcream 's answer solution here: get photos instagram have specific hashtag php) until obviously.. can work locally not @ referred domain have put in @ instagram app. have no idea if has domain-bindings; company (like companies) got dev-server i've binded domain. though has not been problem before when i've used solution grabbing instagram feed.

anyway, know problem be?

here's code:

<?php         // class instagram         // more examples here: https://github.com/cosenary/instagram-php-api         require_once 'instagram.class.php';          // initialize class client_id         // register @ http://instagram.com/developer/ , replace client_id own         $instagram = new instagram('09b639fa2d2845d99d7c3c748f273b30');          // set keyword #hashtag         $tag = 'insta';          // latest photos according #hashtag keyword         $media = $instagram->gettagmedia($tag);          // set number of photos show         $limit = 8;          // show results         // using loop cause error if there less photos limit         foreach(array_slice($media->data, 0, $limit) $data)         {             #print('<pre>'); print_r($data); print('</pre>');             ?>             <div class="insta-item">                 <a href="<?php echo $data->link; ?>" target="_blank">                     <img src="<?php echo $data->images->standard_resolution->url; ?>" height="46px" width="46px" alt="pic" />                 </a>             </div>              <?php         }     ?> 

first, recommend check instagram parameters.

there's known issue usage on localhost of api.

if still doesn't work, try adding limit number of image loaded:

$media = $instagram->gettagmedia($tag, 10); 

Comments