Retrieve the short DOI for one or more DOIs

get_short_doi(
  x = NULL,
  strip10 = TRUE,
  throttle = TRUE,
  throttleTime = 0.1,
  progress = NULL,
  silent = metabefor::opts$get("silent")
)

get_short_dois(
  x = NULL,
  strip10 = TRUE,
  throttle = TRUE,
  throttleTime = 0.1,
  progress = FALSE,
  silent = metabefor::opts$get("silent")
)

Arguments

x

A DOI or a vector of DOIs.

strip10

Whether to strip the leading 10/.

throttle

Whether to wait for throttleTime if no valid JSON containing the short doi is returned (throttle=TRUE) or throw an error (throttle=FALSE).

throttleTime

How long to wait when throttling.

progress

For get_short_dois, whether to show a progress bar; for get_short_doi, optionally, a progress bar to tick after the file has been parsed (must be a progress::progress_bar() object.

Value

The short DOI or DOIs.

Examples

if (FALSE) { # \dontrun{
### Get a short DOI, just the short DOI returned
metabefor::get_short_doi("10.1371/journal.pone.0042793");
metabefor::get_short_doi("10.1890/10-0340.1");
} # }
if (FALSE) { # \dontrun{
### Get a short DOI, just the short DOI returned
metabefor::get_short_dois(
  c("10.1371/journal.pone.0042793",
    "10.1890/10-0340.1")
);
} # }