Skip to content
This repository

return pagination information for .user_recent_media #25

Closed
jonbuda opened this Issue February 27, 2012 · 26 comments

9 participants

Jon Buda Shayne Sweeney Raphael JasonM23 Marcel Molina Gurrinder Ryan Biesemeyer Corey Ward Alberto Bissacco
Jon Buda

In users.rb, I'm wondering why in the user_recent_media method you chose to return response["data"] and not simply response like all other calls that return collections of media?

This makes paginating through a user's recent feed difficult, as you won't easily know what to pass in for the max_id parameter as there's not next_max_id returned.

Was there a particular reason for this choice?

Raphael

working on the same issue.

JasonM23

I might patch this, @rapsli have you got anywhere with this yet?

Raphael

nope.

JasonM23

ok, I'll have a look today.

JasonM23

@rapsli @jonbuda @shayne

Hi Guys, I've been looking at this today, and as far as I can see, changing the return to response instead response["data"] is good enough, however, this would obviously break anything using the current response.

I'm just patching my local gem code for now.

Marcel Molina

The same issue exists with #user_follows so it isn't possible to paginate through results without modifying the code.

JasonM23

I think we should just patch these changes in, @shayne is probably busy as hell right now.

If you just add issues for each instance where the pagination doesn't get sent, I can patch them in my fork and then send over a pull request when they're all done.

Up to individuals how you handle the shortfall but I'd recommend replacing/patching the gem rb files until you know the issue is fixed.

I'm also going to post a more built out example app (using Sinatra) that uses the paging patches. I'll probably announce it here when the thing is in a github repo.

JasonM23

Submitting a patch for this.

Gurrinder

Hey. I am facing the same issue. Any update on this? I realize the pull request was requested almost 2 months ago. Is the issue going to be rectified? Any info will be appreciated.

Thanks.

JasonM23

@gurrinder for the moment I'm just using mine, in my Gemfile

# Custom instagram gem
gem "instagram", :git => 'https://github.com/jasonm23/instagram-ruby-gem.git'

I expect @shayne is busy with other stuff for the moment.

Gurrinder

thanks @jasonm23 . Hope it gets merged in soon.

Shayne Sweeney
Owner
shayne commented May 31, 2012

@jasonm23 want to attach a pull-request to this issue?

JasonM23

@shayne sure, it's this one, #28

However, it doesn't properly address all the issues with response[:data] just the ones that have been an issue for me.

JasonM23

Notably, user_follows, as mentioned above hasn't been addressed.

Ryan Biesemeyer
yaauie commented July 16, 2012

I submitted pull #41 last week to route around all of the truncating-of-meaningful-data issue.

Shayne Sweeney
Owner
shayne commented July 16, 2012

@yaauie Looks pretty good. Would you mind adding tests and perhaps a pagination example to the readme (if not I can later this week), before we cut a new gem? This change would probably warrant a 1.0 release.

JasonM23

@shayne before tagging v.1.0 I think there's some work to do on exception management. (i.e. from Faraday when the IG servers fail.)

Ryan Biesemeyer
yaauie commented July 17, 2012

@shayne I can definitely do that. This change definitely warrants a 0.9.x since it breaks the API, but if you want to go all the way to a 1.0, that's up to you.

Shayne Sweeney
Owner
shayne commented July 17, 2012

Ok– let's plan on better exception handling + API changes for 1.0

JasonM23

Great, I should probably scan my logs for some examples of where IG has responded badly. Mostly they seem to be faraday related, I'll open up some specific issues for them. it's 3am so I'm turning in for the night, I'll have a look tomorrow.

Shayne Sweeney
Owner
shayne commented July 17, 2012
JasonM23

I just remember getting a lot of BadRequest exceptions occurring randomly when the IG servers were up but not responding all the time.

Ryan Biesemeyer
yaauie commented July 19, 2012

We also get JSON (or YAJL or whatever MultiJson adapter we're using) parse errors when the API decides to return an HTML error page (e.g., 502 Bad Gateway or a 404 for a malformed request like https://api.instagram.com/users/USERNAME_INSTEAD_OF_ID?access_token=fubar )

JasonM23

I've opened up a couple of new http status related issues

Corey Ward

Seems like this was all given up on…any chance of getting some attention again?

Shayne Sweeney shayne closed this February 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.