# NOT RUN {
# List publishers included
ft_abstract_ls()
# }
# NOT RUN {
# PLOS
## search
(res <- ft_search(query = 'biology', from = 'plos', limit = 25,
plosopts = list(fq = list('doc_type:full', '-article_type:correction',
'-article_type:viewpoints'))))
## get abstracts
dois <- res$plos$data$id
(out <- ft_abstract(x = dois, from = "plos"))
out$plos
# Semantic Scholar
(out <- ft_abstract(x = dois, from = "semanticscholar"))
out$semanticscholar
## using arxiv ids
arxiv_ids <- c("0710.3491", "0804.0713", "0810.4821", "1003.0315")
(out <- ft_abstract(x = paste0("arXiv:", arxiv_ids), from = "semanticscholar"))
out$semanticscholar
# Scopus
opts <- list(key = Sys.getenv('ELSEVIER_SCOPUS_KEY'))
## search
(res <- ft_search(query = 'biology', from = 'scopus', scopusopts = opts,
limit = 25))
## get abstract
dois <- na.omit(res$scopus$data$`prism:doi`)
out <- ft_abstract(x = dois[1:3], from = "scopus", scopusopts = opts)
out
out$scopus
# use scopus Ids
(res <- ft_search(query = 'biology', from = 'scopus', scopusopts = opts,
limit = 50))
ids <- fulltext:::strextract(res$scopus$data$`dc:identifier`, "[0-9]+")
(out <- ft_abstract(x = ids[1:4], from = 'scopus',
scopusopts = list(
key = Sys.getenv('ELSEVIER_SCOPUS_KEY'),
id_type = "scopus_id"
)
))
# Microsoft
key <- Sys.getenv("MICROSOFT_ACADEMIC_KEY")
(res <- ft_search("Y=[2010, 2012)", from = "microsoft",
maopts = list(key = key)))
ids <- res$ma$data$Id
(out <- ft_abstract(x = ids, from = "microsoft",
maopts = list(
key = Sys.getenv('MICROSOFT_ACADEMIC_KEY')
)
))
out$ma
cat(unlist(lapply(out$ma, "[[", "abstract")), sep = "\n\n")
# Crossref
(res <- ft_search("ecology", from = "crossref",
crossrefopts = list(filter = c(has_abstract = TRUE))))
ids <- res$crossref$data$doi
(out <- ft_abstract(x = ids, from = "crossref"))
out$crossref
# curl options
ft_abstract("10.2458/v17i1.21696", from = "crossref", verbose = TRUE)
ft_abstract("10.1371/journal.pcbi.1002487", from = "plos", verbose = TRUE)
# }
Run the code above in your browser using DataLab