Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Implement TWIT_get and TWIT_post helpers #483

Closed
hadley opened this issue Feb 21, 2021 · 2 comments
Closed

Implement TWIT_get and TWIT_post helpers #483

hadley opened this issue Feb 21, 2021 · 2 comments

Comments

@hadley
Copy link
Collaborator

hadley commented Feb 21, 2021

I'd suggest adding helpers that looked something like this:

TWIT_get <- function(query, param, ..., token = NULL) {
  old <- options(scipen = 15)
  on.exit(options(old))
  
  token <- check_token(token)
  url <- make_url(query = query, param = param)
  httr::GET(url, ..., token)
}

This logic is currently spread over many functions. I suspect these functions should probably also incorporate warn_for_twitter_status() and from_js() so that API errors are also handled in one place.

@hadley
Copy link
Collaborator Author

hadley commented Feb 24, 2021

And warn_for_twitter_status() should be replaced with stop_for_twitter_status().

@hadley
Copy link
Collaborator Author

hadley commented Mar 4, 2021

Closing, since this is now done.

@hadley hadley closed this as completed Mar 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants