prowdsponsor / ig

Bindings to Instagram's API
Other
11 stars 14 forks source link

using client_id instead of access_token #15

Closed cdepillabout closed 9 years ago

cdepillabout commented 9 years ago

Based on a couple of simple tests, it seems like many of Instagram's endpoints allow you to use a client_id instead of an access token.

https://instagram.com/developer/endpoints/?hl=en

However, it doesn't seem like ig supports the use of client_id. Are there any plans for supporting client_id in addition to access_token?

meteficha commented 9 years ago

Many endpoints already don't require an OAuthToken, e.g. searchUsers. Which endpoints currently needlessly require an OAuthToken?

cdepillabout commented 9 years ago

/users/{user-id}/media/recent requires either an access_token parameter (OAuthToken) OR a client_id parameter.

https://instagram.com/developer/endpoints/users/#get_users_media_recent

However, getRecent requires an OAuthToken. It doesn't have any option to use a client_id instead of an access_token.

https://instagram.com/developer/endpoints/users/#get_users_media_recent

meteficha commented 9 years ago

I've given you commit access, @cdepillabout, you're free to directly make the change in the API or send a PR that I may happily review. Don't forget to do a major version bump and add your name to ig.cabal! :)

Also, let me know what your Hackage user name is so that i can set you up as a maintainer to allow you to push new versions without having to wait for me.

cdepillabout commented 9 years ago

@meteficha Thank you.

I'll play around with it and think about an elegant way to implement using either access_token or client_id.

As for Hackage, I'm not actually registered. However, if I can make the above change to ig, I'll register and let you know my Hackage username.

cdepillabout commented 9 years ago

After looking at the code, I think I was completely wrong about OAuthToken and client_id. It looks like client_id is used by default when not passing an OAuthToken.

I submitted a pull request (#16) that changes getRecent to not require an OAuthToken.

cdepillabout commented 9 years ago

I will register on Hackage and let you know my Hackage username.

cdepillabout commented 9 years ago

I made an account on Hackage. My Hackage username is cdepillabout.

https://hackage.haskell.org/user/cdepillabout

meteficha commented 9 years ago

You're now one of ig's maintainers, let me know if you're able to upload the new version :).

cdepillabout commented 9 years ago

I was able to upload version 0.5 to Hackage:

https://hackage.haskell.org/package/ig-0.5

Thanks!

meteficha commented 9 years ago

Awesome! Now please add a 0.5 tag to the repo. You may do something like:

$ git tag -a 0.5 -m 0.5
$ git push upstream --tags

Thanks :).

cdepillabout commented 9 years ago

Thanks!

I pushed the tag:

https://github.com/prowdsponsor/ig/tree/0.5