-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublications.qmd
43 lines (39 loc) · 1016 Bytes
/
publications.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: "Publications"
format:
html:
from: markdown+autolink_bare_uris
---
```{=html}
<!--
Because the rendered site is frozen, an update to the source code (i.e. this document) is required to update the page. After adding a publication to Zotero and syncing, edit this comment (add a space or something), `quarto_render()`, then push to GitHub to update the website. ||||||||||
-->
```
```{r}
#| echo: false
#| output: asis
library(httr2)
library(stringr)
req <-
request("https://api.zotero.org") |>
req_url_query(
v = 3,
include = "bib",
sort = "date",
style = "journal-of-ecology",
itemType = "journalArticle || bookSection || book"
) |>
req_headers(`Zotero-API-Key` = Sys.getenv("ZOTERO_API_KEY")) |>
req_url_path("users", "6720834", "publications", "items") |>
req_retry()
resp <-
req |>
req_perform()
resp |>
resp_body_json() |>
purrr::map("bib") |>
unlist() |>
# Bold my name
str_replace("(Scott, E\\. R\\.)", '<b>\\1</b>') |>
cat()
```