redvine icon indicating copy to clipboard operation
redvine copied to clipboard

Can't do pagination

Open stefansundin opened this issue 11 years ago • 3 comments

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 avatar Sep 25 '14 00:09 stefansundin

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.

stefansundin avatar Sep 25 '14 21:09 stefansundin

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

stakes avatar Nov 08 '14 23:11 stakes

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).

stefansundin avatar Nov 09 '14 00:11 stefansundin