core_articles_history: Get article history

Description Usage Arguments Details Value References Examples

View source: R/core_articles_history.R

Description

Get article history

Usage

1
2
3
core_articles_history(id, page = 1, limit = 10, key = NULL, parse = TRUE, ...)

core_articles_history_(id, page = 1, limit = 10, key = NULL, ...)

Arguments

id

(integer) CORE ID of the article that needs to be fetched. One or more. Required

page

(character) page number (default: 1), optional

limit

(character) records to return (default: 10, minimum: 10, maximum: 100), optional

key

A CORE API key. Get one at https://core.ac.uk/api-keys/register. Once you have the key, you can pass it into this parameter, or as a much better option, store your key as an environment variable with the name CORE_KEY or an R option as core_key. See ?Startup for how to work with env vars and R options

parse

(logical) Whether to parse to list (FALSE) or data.frame (TRUE). Default: TRUE

...

Curl options passed to HttpClient

Details

core_articles_history does the HTTP request and parses, while core_articles_history_ just does the HTTP request, gives back JSON as a character string

Value

core_articles_history_ returns a JSON string on success. core_articles_history returns a list (equal to id length) where each element is a list of length two with elements for data and status of the request; on failure the data slot is NULL.

References

https://core.ac.uk/docs/#!/articles/getArticleHistoryByCoreId

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
core_articles_history(id = 21132995)

ids <- c(20955435, 21132995, 21813171, 22815670, 14045109, 23828884,
   23465055, 23831838, 23923390, 22559733)
res <- core_articles_history(ids)
vapply(res, function(z) z$data$datetime[1], "")

# just http request, get text back
core_articles_history_(21132995)

## End(Not run)

rcoreoa documentation built on July 8, 2020, 7:30 p.m.