2024-03-13 15:33:20 +01:00
|
|
|
orcid_pubs <- function(orcid, path="bib-files/publications.bib"){
|
2023-05-08 11:23:49 +02:00
|
|
|
dois <- Reduce(c,lapply(orcid,function(o){
|
|
|
|
works <- rorcid::orcid_works(orcid)[[1]]
|
|
|
|
|
|
|
|
Reduce(c, do.call(
|
|
|
|
cbind,
|
|
|
|
lapply(works$works$`external-ids.external-id`, function(a) {
|
|
|
|
if ("doi" %in% c(a[[1]])) {
|
|
|
|
s <- do.call(cbind, a)
|
|
|
|
s[, "external-id-normalized.value"][s[, "external-id-type"] == "doi"]
|
|
|
|
# Using the normalized values, a check has been run for bad DOIs
|
|
|
|
}
|
|
|
|
})
|
|
|
|
)) |> na.omit() |> unique()
|
|
|
|
}))
|
2024-03-13 15:33:20 +01:00
|
|
|
|
2023-05-08 11:23:49 +02:00
|
|
|
RefManageR::GetBibEntryWithDOI(dois) |> rbibutils::writeBib(path)}
|