How to cite a journal article in wikipedia?

The User:Apoc2400 created a simple citation generator for articles (or other documents) associated with a digital object identifier (doi).

This tool is available at //reftag.appspot.com/doiweb.py

The output can be copy and pasted directly into a wikipedia editing page.

In this R-script,  I use this the program wget to send a request to this tool, and use the xml2 library to read the output and extract the text information.

 

mi.doi <- "10.1002/ece3.3628"
mi.tool <- "//reftag.appspot.com/doiweb.py"
system(sprintf("wget -O prueba '%s?doi=%s",
         mi.tool,
         mi.doi))

require(xml2)
rsp <- read_html("prueba",encoding="utf8")
xml_text(xml_find_all(rsp,"//textarea[@id='fullcite']"))