Site Integration - Instagram API - PHP

Asked

Viewed 10,290 times

1

I don’t know what happened, but it was working on my Instagram integration site. I did a photo randomization. But out of the blue, the images no longer appear.

For those who know the Instagram Developers API Console, I tested the parameters and they worked. Does anyone know if you’ve had any changes to the way you authenticate on Instagram... ? Or if CURL might be a problem if you change the PHP version ?

Follow the code below:

include_once 'instagram.class.php';
$insta_settings = array(
  'client_id'       => '***********',
  'client_secret'   => '***********',
  'redirect_uri'    => 'http://********.com.br/auth/instagram',
  'scope'           => array('likes')
);

---------------------------------------------------------------

define('INSTAGRAM_ID', '**********');
define('INSTAGRAM_TOKEN', '**********');
$insta_settings['access_token'] = INSTAGRAM_TOKEN;
$instagram  = new Instagram($insta_settings);
$instagram->initRequest('GET');
$instagram->requestUrl('/users/'.INSTAGRAM_ID.'/media/recent');
$images     = $instagram->performRequest();

If I make one print_r($images) doesn’t catch anything. The class I’m using is this:

https://github.com/marlonmarcello/simple-php-instagram-api

  • 1

    All my sites that integrated with the instagram API stopped working. I’m now using this http://instafeedjs.com/

  • Yeah, man? Noss.... I’m gonna punch Instagram in the face.

  • @Erloncharles, by the way instafeed.js has the function of Like ?

  • Like an image? So far I haven’t seen this, but it may be in implementation

  • @Erloncharles, I get it. And is there any way I can put an image of my choice in a DIV, for example ? Still image...

  • Yes, you can create a template for the return of the image(s))

  • I get it. I learned well up to this library. It’s not so hard. Thanks for the referral. If you want to put as an answer for me to choose.

  • OK I’ll put in the answer

Show 3 more comments

1 answer

4


I had a similar problem with my sites that used the Intagram api, I don’t know for sure why yet, but I started using this library to do the integration instafeedjs.

Intallation

<script type="text/javascript" src="path/to/instafeed.min.js"></script>

Basic use

<script type="text/javascript">
    var feed = new Instafeed({
        get: 'tagged',
        tagName: 'awesome',
        clientId: 'YOUR_CLIENT_ID'
    });
    feed.run();
</script>

Obs:
A way I found to make the Likes in the images was open the image clicked on a modal so the person can give like in the direct image on instagram

  • 2

    Thanks, Erlon. I did it. It got faster even than the other one that was using it. Cool the idea of Modal. I’ll see if it fits that way. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.