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

Consistent pagination interface #510

Closed
15 of 16 tasks
hadley opened this issue Feb 27, 2021 · 7 comments
Closed
15 of 16 tasks

Consistent pagination interface #510

hadley opened this issue Feb 27, 2021 · 7 comments

Comments

@hadley
Copy link
Member

hadley commented Feb 27, 2021

Cursors

Add next_cursor attribute to outptut (of single inputs). Should pass cursor, retryratelimitandverbosearguments on toTWIT_paginate_cursor()`.

  • direct_messages()
  • get_followers()
  • get_friends()
  • lists_members()
  • lists_memberships()
  • lists_subscribers()
  • lists_subscriptions()

max_id

Add max_id attribute to outptut (of single inputs). Should pass since_id, max_id, retryratelimit and verbose on TWIT_paginate_max_id().

  • get_favorites()
  • get_my_timeline()
  • get_timeline()
  • get_mentions()
  • lists_statuses()
  • search_tweets()

Other

  • search_users() — uses page paramter
  • lookup_users()TWIT_paginate_chunked()
  • lookup_tweets()TWIT_paginate_chunked()
hadley added a commit that referenced this issue Feb 28, 2021
* Drastically simplify rate_limit() — now supports one way of filtering
* Paginated requests return early (with warning) when rate limited 
* Can opt-in to waiting for next reset with `retryratelimit = TRUE`
* Documentation improvements applied to `get_followers()` and `search_tweets()`. Rest tracked in #510.
@hadley
Copy link
Member Author

hadley commented Mar 4, 2021

Consider sleep_on_rate_limit instead of retryratelimit. Would need to deprecate functions already using retryratelimit.

@hadley
Copy link
Member Author

hadley commented Apr 2, 2021

@llrs do you have any thoughts on argument name? I think sleep_on_rate_limit is slightly easier to read and a more accurate description of what it does, but I don't feel that strongly about it. (But I do only want to make the change once, since it's a bunch of functions that need this as an argument.)

@hadley
Copy link
Member Author

hadley commented Apr 2, 2021

Common documentation in progress in #554

@llrs
Copy link
Member

llrs commented Apr 2, 2021

I think it might be slightly easier to understand wait_on_rate_limit, but it is still long. (wait_on_limit?)

@hadley
Copy link
Member Author

hadley commented Apr 3, 2021

Cursor plan:

  • Add rtweet_cursor attribute to result of TWIT_paginate_cursor
  • Ensure parsing preserves/restores the attribute
  • Re-work next_cursor() following max_id()/since_id()
  • Ensure all functions have necessary arguments

@hadley
Copy link
Member Author

hadley commented Apr 3, 2021

I'm going to leave my_friendships() and lookup_friendships() as is as there doesn't appear to be any indication that they're actually used anywhere (e.g. https://github.com/search?l=R&q=my_friendships&type=Code).

hadley added a commit that referenced this issue Apr 5, 2021
* Use TWIT_paginate_max_id in all functions that retrieve tweets
* Restore `max_id()` and `since_id()` and apply automatically
* Include a few examples

Part of #510
@hadley
Copy link
Member Author

hadley commented Apr 6, 2021

I'm going to close now; search_users() uses its own unique pagination style so while we certainly could make consistent with everything else, I don't think it's particularly high priority.

@hadley hadley closed this as completed Apr 6, 2021
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