Skip to content

Commit

Permalink
Warn on commas in openalex lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
hughjonesd committed Jul 25, 2024
1 parent 0c4cb7c commit 2cf5fb5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/lookup-publication-outcomes.R
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,13 @@ lookup_journal_openalex <- function (title, authors = character(0L)) {
#' as given by openalex. There may be more than one matching name per author.
#'
lookup_authors_openalex <- function (authors) {
if (any(stringr::str_detect(authors, ","))) {
warning("Removing commas from authors in `lookup_authors_openalex()`")
}
authors <- stringr::str_remove(authors, ",")
author_string <- paste(authors, collapse = "|")


req <- request("https://api.openalex.org/authors") %>%
req_headers(
mailto = openalex_email
Expand Down

0 comments on commit 2cf5fb5

Please sign in to comment.