# \donttest{
# Connect to the public group "c2z_delete"
# NB! This process can be done using only `Zotero` (see README)
zotero <- Zotero(
user = FALSE,
id = "4988497",
api = "RqlAmlH5l1KPghfCseAq1sQ1"
)
# Create a new collection for POST
zotero$collections <- tibble::tibble(
key = ZoteroKey(),
version = 0,
name = "Post-test",
parentCollection = "FALSE"
)
# Add item to post using `ZoteroAdd` (and `ZoteroDoi`)
zotero <- ZoteroAdd(
zotero,
doi = "10.1126/sciadv.abd1705"
)
# Post a DOI to the public group "c2z_delete"
example <- ZoteroPost(
zotero,
post.collections = TRUE,
post.items = TRUE
)
# Delete collections and items using `ZoteroDelete`
delete.example <- ZoteroDelete(
zotero,
delete.collections = TRUE,
delete.items = TRUE
)
# Print index using `ZoteroIndex`
if (any(nrow(example$items))) {
ZoteroIndex(example$items) |>
dplyr::select(name) |>
print(width = 80)
}
# }
Run the code above in your browser using DataLab