Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't do pagination #9

Open
stefansundin opened this issue Sep 25, 2014 · 3 comments
Open

Can't do pagination #9

stefansundin opened this issue Sep 25, 2014 · 3 comments

Comments

@stefansundin
Copy link
Contributor

I'm trying to use the popular endpoint, and I can't do pagination with redvine because get_request_data has records=true hardcoded.

I need the anchor property that is outside the array of items to do proper pagination.

I might resort to forking the gem.

@stefansundin
Copy link
Contributor Author

Looking at it further you can actually generate the anchor yourself. It's simply a unix timestamp of when you started pagination. But still, these properties should be accessible somehow.

@stakes
Copy link
Owner

stakes commented Nov 8, 2014

@stefansundin did you ever get into this at all or has it not been a problem for you?

@stefansundin
Copy link
Contributor Author

I forked this to https://github.com/stefansundin/redvine and applied a few changes.

  • You no longer need to login. You can do requests un-authenticated, you can do a lot of things like get user profiles while you're unauthenticated. Also, I noticed that if you do requests unauthenticated, then you don't have a limit on how many requests you can do (it's probably hitting cache servers), but if you are logged in, you will eventually get errors (note that I made a lot of requests).
  • You can "login" using a session key you previously got by logging in. By using this you don't necessarily need to put your username and password in your configuration settings. The key might expire though, so that's something to watch out for.
  • I changed how the data is returned, it now returns all of the data and not just the items array. This is one of the biggest reasons I haven't submitted a PR, because it breaks compatibility.
  • I added a few exception handlers for various network failures.

Also, because I merged the old PRs, maybe it's time to release a new version with those fixes. My changes probably belong in a new major version, or maybe the incompatibility can be resolved by having a new argument that lets you get the "raw" data (e.g. by exposing the records argument in get_request_data to the public functions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants