cosenary / Instagram-PHP-API

An easy-to-use PHP Class for accessing Instagram's API.
http://cosenary.github.com/Instagram-PHP-API
BSD 3-Clause "New" or "Revised" License
1.46k stars 782 forks source link

Instagram Platform Update #182

Closed vinkla closed 7 years ago

vinkla commented 8 years ago

On the 17 Nov 2015 Instagram made changes to their API . Apps created before Nov 17, 2015 wont be affected until Jun 2016. Apps created on or after Nov 17 2015 will require to use their updated API. Please note that this library doesn't yet support their new updates.

When we launched our first Instagram API in 2011, we were a very small team and knew we wouldn’t be able to build all the features our community might want. Today we are announcing several platform changes to improve people’s control over their content and set up a more sustainable environment built around authentic experiences on the platform… http://developers.instagram.com/post/133424514006/instagram-platform-update

I guess we need to rethink this entire library in order to work with the latest changes. This will require a lot of efforts and there is currently no plan to update this library.


If you're just looking for a simple way to fetch a public Instagram feed, you can checkout this package: vinkla/instagram.

bcbud commented 8 years ago

Looks like they updated /media/search to require auth...

Instagram.php (227)

 public function searchMedia($lat, $lng, $distance = 1000, $minTimestamp = NULL, $maxTimestamp = NULL) {
    return $this->_makeCall('media/search', false, array('lat' => $lat, 'lng' => $lng, 'distance' => $distance, 'min_timestamp' => $minTimestamp, 'max_timestamp' => $maxTimestamp));
  }

needs the false $auth to be set to true

 public function searchMedia($lat, $lng, $distance = 1000, $minTimestamp = NULL, $maxTimestamp = NULL) {
    return $this->_makeCall('media/search', true, array('lat' => $lat, 'lng' => $lng, 'distance' => $distance, 'min_timestamp' => $minTimestamp, 'max_timestamp' => $maxTimestamp));
  }
jufy commented 8 years ago

Also need to update scopes https://instagram.com/developer/authorization/ — basic - to read a user’s profile info and media (granted by default) — public_content - to read any public profile info and media on a user’s behalf — follower_list - to read the list of followers and followed-by users — comments - to post and delete comments on a user’s behalf — relationships - to follow and unfollow accounts on a user’s behalf — likes - to like and unlike media on a user’s behalf

sbolognini commented 8 years ago

Hi, now even the getTagMedia needs an access_token to work. I have a big doubt: how can I have access to recent media without making the user to login? I explain myself: I built a website with a backend area. In this area I add the authentication data for an Instagram app (Client ID and Client Secret) and a tag. The frontend shows the recent medias for that tag. Simple. Now things are changed and an access_token is needed. So how can I show the same recent medias without make the user login to Instragram? The app only shows the global recent medias, not user info. I reviewed the repository code, but I cannot understand how THE APP could generate via code an access_token to be used for recent media query.

Thanks for your time.

Simone.

iadj commented 8 years ago

Is it possible to still use this API with the update apart from some of the features that require updating the API?

odelrio commented 8 years ago

To fix photo uploading...

  1. In Instagram::GenerateSignature() replace the key with: 3f0a7d75e094c7385e3dbaa026877f2e067cbd1a4dbcf3867748f6b26f257117
  2. Replace the User Agent with: Instagram 7.1.1 (Android; 21/5.0.2; 480dpi; 1080x1920; OnePlus/ONEPLUS; A0001; A0001; qcom; en_US)
  3. Set ig_sig_key_version=6 to ig_sig_key_version=4.
shrunyan commented 8 years ago

@iadj Yes it is. I'm still currently using it to fetch hashtag based media but have lost access to user media due to the public_content scope addition.

phirestalker commented 8 years ago

the scopes problem is easily patched by editing line 74 to read:

private $_scopes = array('basic', 'public_content', 'follower_list', 'likes', 'comments', 'relationships');

sanikkenway commented 8 years ago

I'm getting turned down couple of times for submission on basic and public_content, what actually I have to provide for the submission? I just want to curl trending Instagram photos into php this is sample for now as I can only curl for my own media only

https://sanik.my/gallery/instagram

any insights?

Brumley commented 8 years ago

Hello, did anyone get the permission review accepted after the update? I followed the valid use cases and i got the permissions declined everytime i tried it. Thanks

phirestalker commented 8 years ago

I'd give up on instagram if I were you. They don't like anyone but them making money from their platform, and they could give a shit about the developers. They change the rules all the time, usually without warning.

On Mon, Feb 1, 2016 at 8:35 AM, Brumley notifications@github.com wrote:

Hello, did anyone get the permission review accepted after the update? I followed the valid use cases and i got the permissions declined everytime i tried it. Thanks

— Reply to this email directly or view it on GitHub https://github.com/cosenary/Instagram-PHP-API/issues/182#issuecomment-178025120 .

florianbeer commented 8 years ago

I've just submitted a pull request https://github.com/cosenary/Instagram-PHP-API/pull/204 that should fix this package to work with Instagram's API changes. @cosenary please consider merging this in and thanks for your very helpful library!

vinkla commented 8 years ago

Until this is fixed everyone could check out this repository https://github.com/hassankhan/instagram-sdk

florianbeer commented 8 years ago

Why don't you accept pull requests on this repo? In #204 I fixed everything and as far as I can see it's perfectly usable again.

vinkla commented 8 years ago

Please bare in mind that I'm not the maintainer. I've only helped out with the syntax changes.

florianbeer commented 8 years ago

Sorry, I thought you had merge rights as well. Anybody knows if the author is still willing to maintain this project? If not, I'll switch out this package with my fork in my composer.json and be done with it.

iadj commented 8 years ago

@florianbeer Please do. Last time this git was updated was last year.

melnikoved commented 8 years ago

@florianbeer Could you publish your fork? And we will be able to enjoy this library with new API

florianbeer commented 8 years ago

Already did, a week ago: https://github.com/florianbeer/Instagram-PHP-API

melnikoved commented 8 years ago

Yes. But it is still "fork". It would be great if you changed name of library from "cosenary/instagram" to your. So we can use composer to upload it.

florianbeer commented 8 years ago

But that would be stealing, it is still @cosenary's work.

You can add the following to your composer.json to use my fork:

"repositories": [                                                                                                                                                                
    {                                                                                                                                                                            
        "url": "https://github.com/florianbeer/Instagram-PHP-API.git",                                                                                                           
        "type": "git"                                                                                                                                                            
    }                                                                                                                                                                            
],

and then require "cosenary/instagram": "dev-master"

melnikoved commented 8 years ago

But if I use "dev-master" - it upload a last stable commit. How can I use your last commits?

florianbeer commented 8 years ago

https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository

melnikoved commented 8 years ago

Yes. It works now. But I have now

Invalid state

        || ($this->getInput('state') !== $this->store->get('oauth2state'))
    ) {
        $this->store->set('oauth2state', null);
        throw new CsrfException('Invalid state');
    }
    return;
}
Brumley commented 8 years ago

hello guys, has anything changed with API permission review? Did anyone get the permission from instagram to any scope? Thanks

smvanbru commented 8 years ago

@florianbeer , this is an open-source project. If @cosenary is no longer maintaining it (and that seems to be the case given that he hasn't chimed in on any of this yet), creating a new non-forked repo that gives attribution to @cosenary seems to me to be a legitimate way to keep the project moving forward. For those of use who are trying to build production-level systems, it would be nice to be able to include a stable source in our composer setup. Thanks!

florianbeer commented 8 years ago

This package is still 99,9% @cosenary's work. If he wants me to take over and clearly states so, I will think about it, not sooner. If you want to use my fork in the meantime, you can alter your composer.json to fetch the code from my repository.

BR0kEN- commented 7 years ago

@florianbeer, with the repositories inside of composer.json and dev-master won't work. See https://github.com/composer/composer/issues/2622

Supposed that @cosenary are no longer interested in development on Github anymore.

timothymarois commented 7 years ago

I'm assuming this API is dead now that is hasnt been updated to the new Instagram API changes of last year? So its not worth utilizing at all?

timothymarois commented 7 years ago

@florianbeer if cosenary is not here to maintain a broken system, It must move on. No matter who created the work. It must move on and adapt. If it's from the original author or not. That is open source.

pvledoux commented 7 years ago

@florianbeer Do we have any update on this issue? If anyone want to take the responsibility of this repo, can we just create a fresh one without hurt anybody? It's really blocking for a lot of people.

florianbeer commented 7 years ago

Well I would be open to maybe transferring my fork to a GitHub organisation and publishing it to Packagist if I can get some co-maintainers. I don't think there's enough incentive for me to take care of issues, PRs etc. all on my own, seeing that my fork does everything I need it to do for my project for the foreseeable future.

So any volunteers to take on a (co-) maintainer role in an open source project and spending countless hours of unpaid work on keeping it up to date?

dimassrio commented 7 years ago

@florianbeer I want to volunteer, since I'm gonna also use the API for some prototyping, might as well explore the API depthly and help the public.

BR0kEN- commented 7 years ago

@florianbeer I'm gonna help as well if you are not have concerns. Currently I had to do a fork from your fork and created a Composer package on its basis: https://github.com/propeopleua/Instagram-PHP-API

But I do not like this!

florianbeer commented 7 years ago

@dimassrio I've added you as collaborator (push permission) on my repository and will publish it on packagist today.

Anybody else who wants to participate, please feel free to give me a shout!

florianbeer commented 7 years ago

@BR0kEN- great, you're added as well.

florianbeer commented 7 years ago

Hmm, seems I have to "un-fork" (is that the correct GitHub terminology), to publish to packagist. I will investigate further later today, as now I have to leave for a meeting.

pvledoux commented 7 years ago

@florianbeer cool! I can help, no problem!

BR0kEN- commented 7 years ago

@florianbeer, you can publish forks but this practice isn't recommended. So, better to create an independent package.

pvledoux commented 7 years ago

Hi @florianbeer, any news on this?

killua99 commented 7 years ago

Lookin forward to use your fork @florianbeer

pvledoux commented 7 years ago

@florianbeer This again .. ;) Actually, if you rename your forked branch as dev-master, we will be able to use your repository in composer. See http://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer. I just tried by forked your branch and it worked.

vinkla commented 7 years ago

It has been over a year now. I'm closing this.

BR0kEN- commented 7 years ago

Everyone who need this could use forked package: https://github.com/propeopleua/Instagram-PHP-API/blob/master/composer.json#L2

vinkla commented 7 years ago

If you're looking for a simple way to fetch a public Instagram feed, you can checkout this package: vinkla/instagram.

PanMan commented 7 years ago

https://github.com/Andreyco/Instagram-for-PHP works and is supported