Skip to content

Commit

Permalink
pull upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanetteclark committed Sep 17, 2024
2 parents bbafe77 + 89d5297 commit 9a35e17
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
18 changes: 10 additions & 8 deletions R/citation_search_scopus.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ citation_search_scopus <- function(identifiers) {
report_est_wait(length(identifiers), wait_seconds)

key <- scythe_get_key("scopus")

# initialize df for storing results in orderly fashion
scopus_results <- data.frame(
article_id = character(),
article_title = character(),
dataset_id = character(),
source = character()
)

if (is.na(key)) {
warning(
"Skipping Scopus search due to missing API key. Set an API key using scythe_set_key() to include Scopus results."
)
return()
return(scopus_results)
}
identifiers_enc <- utils::URLencode(identifiers, reserved = TRUE)

Expand All @@ -40,13 +49,6 @@ citation_search_scopus <- function(identifiers) {
))
}

# initialize df for storing results in orderly fashion
scopus_results <- data.frame(
article_id = character(),
article_title = character(),
dataset_id = character(),
source = character()
)

# extract relevant information from raw results
for (i in 1:length(results)) {
Expand Down
10 changes: 9 additions & 1 deletion R/citation_search_springer.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ citation_search_springer <- function(identifiers) {
report_est_wait(length(identifiers), wait_seconds)

identifiers <- check_identifiers(identifiers)

# initialize df for storing results in orderly fashion
springer_results <- data.frame(
article_id = character(),
article_title = character(),
dataset_id = character(),
source = character()
)

key <- scythe_get_key("springer")
if (is.na(key)) {
warning(
"Skipping Springer search due to missing API key. Set an API key using scythe_set_key() to include Springer results."
)
return()
return(springer_results)
}

identifiers_enc <- utils::URLencode(identifiers, reserved = TRUE)
Expand Down

0 comments on commit 9a35e17

Please sign in to comment.