crm_html | R Documentation |
Get full plain text
crm_html(url, overwrite_unspecified = FALSE, ...)
url |
A URL (character) or an object of class |
overwrite_unspecified |
(logical) Sometimes the crossref API returns
mime type 'unspecified' for the full text links (for some Wiley dois
for example). This parameter overrides the mime type to be |
... |
Named curl options passed on to crul::verb-GET, see
|
Note that this function is not vectorized. To do many requests use a for/while loop or lapply family calls, or similar.
Note that some links returned will not in fact lead you to full text
content as you would understandbly think and expect. That is, if you
use the filter
parameter with e.g., rcrossref::cr_works()
and filter to only full text content, some links may actually give back
only metadata for an article. Elsevier is perhaps the worst offender,
for one because they have a lot of entries in Crossref TDM, but most
of the links that are apparently full text are not in facct full text,
but only metadata.
Check out auth for details on authentication.
You can optionally set a user agent string with the curl option useragent
,
like crm_text("some doi", "pdf", useragent = "foo bar")
.
user agent strings are sometimes used by servers to decide whether to
provide a response (in this case, the full text article). sometimes, a
browser like user agent string will make the server happy. by default all
requests in this package have a user agent string like
libcurl/7.64.1 r-curl/4.3 crul/0.9.0
, which is a string with the names
and versions of the http clients used under the hood. If you supply
a user agent string using the useragent
curl option, we'll use it instead.
For more information on user agent's, and exmaples of user agent strings you
can use here, see
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
## Not run: link <- crm_links("10.7717/peerj.1545", "html") crm_html(link) link <- crm_links("10.7717/peerj.1545") crm_html(link) crm_html("https://peerj.com/articles/1545.html") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.