Census a library through the API
ztCensus.RdReturns top-level and Trash counts for one library, plus per-collection counts when collection keys are supplied.
Arguments
- config
A
zotConfig()object.- library
"user"or a group id.- collectionKeys
Optional named character vector: name -> key.
Details
Each scope is counted from the API Total-Results response header while
requesting only one record. Supplying named collection keys adds one row per
requested collection without downloading the library contents.
See also
zotGet(), zotLocalItems(), and zotVerify().
Examples
Performer <- function(config, method, path, query, body, version) {
Total <- if (grepl("/trash", path)) "7" else "100"
list(status = 200L, headers = list(`total-results` = Total), body = list())
}
Config <- structure(
list(userID = "42", key = "example", apiBase = "https://example.invalid",
performer = Performer),
class = "zotConfig"
)
ztCensus(Config)
#> scope total
#> <char> <int>
#> 1: top 100
#> 2: trash 7