HBat
HBat

Reputation: 5682

Exporting citation of a journal article using R

I want R to:

  1. Go THIS page.
  2. Select "Bibtex" as Format, "Citation and Abstract" for "Export type".
  3. Press "Submit" and download the citation file to a designated folder.

Is it possible? How can I do that with R? (I don't know JavaScript and I couldn't understand earlier topics much related to this issue. 1, 2, 3)

Eventually, I want to download all bibtex (and possibly Endnote) citations of a journal (for example THIS journal).

Upvotes: 0

Views: 570

Answers (2)

sckott
sckott

Reputation: 5893

I think rcrossref https://github.com/ropensci/rcrossref#citation-search can help you here, e.g.,

install.packages("rcrossref")
library("rcrossref")    

cat(cr_cn(dois = "10.1126/science.169.3946.635", format = "bibtex"))
#> @article{Frank_1970,
#>  doi = {10.1126/science.169.3946.635},
#>  url = {http://dx.doi.org/10.1126/science.169.3946.635},
#>  year = 1970,
#>  month = {aug},
#>  publisher = {American Association for the Advancement of Science ({AAAS})},
#>  volume = {169},
#>  number = {3946},
#>  pages = {635--641},
#>  author = {H. S. Frank},
#>  title = {The Structure of Ordinary Water: New data and interpretations are yielding new insights     into this fascinating substance},
#>  journal = {Science}
#> }

With this you just need the DOI's. There are other functions in the package to search for articles and get DOIs by publisher, etc.

hope that helps

Upvotes: 5

MrFlick
MrFlick

Reputation: 206167

You can fake a form submission with the httr package. For this request you could do

values <- list(
    doi = "10.1002%2Fasi.21577",
    fileFormat = "BIBTEX",
    hasAbstract = "CITATION_AND_ABSTRACT"
)

library(httr)
url <- "http://onlinelibrary.wiley.com/documentcitationdownloadformsubmit"
rr <- POST(url=url, body=values, encode="form")
content(rr, "text")
# [1] "@article {ASI:ASI21577,\nauthor = {Callahan, Ewa S. ...

Upvotes: 4

Related Questions