-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththe_team.qmd
103 lines (95 loc) · 3.35 KB
/
the_team.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Oxinfer
Oxinfer is part of the wider [Health Data Sciences section](https://www.ndorms.ox.ac.uk/research/research-groups/Musculoskeletal-Pharmacoepidemiology) (lead by [Prof. Daniel Prieto-Alhambra](https://www.ndorms.ox.ac.uk/team/daniel-prieto-alhambra))

## The Oxinfer team
Meet the members of the team.
::: {.callout-note collapse="true"}
### Edit your description
Name, picture, job title and description of each member of the team is pulled from <https://www.ndorms.ox.ac.uk> please refer to the relevant team to edit it.
:::
```{r, echo = FALSE, eval = TRUE, results='asis', warning=FALSE, message=FALSE}
web <- "https://www.ndorms.ox.ac.uk/team/"
x <- dplyr::tibble(
ndorms_id = c(
"edward-burn", "marti-catala-sabate", "danielle-newby", "mike-du",
"yuchen-guo", "theresa-burkard", "xihang-chen", "kim-lopez-guell",
"pablo-spivakovsky-gonzalez", "marta-alcalde-herraiz",
"nuria-mercade-besora", "elin-rowlands"),
github = c(
"edward-burn", "catalamarti", "daniellenewby", "ilovemane", "MimiYuchenGuo",
"tiozab", "xihang-chen", "KimLopezGuell", "pablosg713", "martaalcalde",
"nmercadeb", "elinrow"
),
email = c(
"edarwd.burn@ndorms", "marti.catalasabate@ndorms", "danielle.newby@ndorms",
"mike.du@ndorms", "yuchen.guo@ndorms", "theresa.burkard@ndorms",
"xihang.chen@ndorms", "kim.lopez@spc", "pablo.spivakovskygonzalez@ndorms",
"marta.alcaldeherraiz@ndorms", "nuria.mercadebesora@ndorms",
"elin.rowlands@ndorms"
),
twitter = "",
linkedin = ""
)
getLab <- function(line, lab) {
cometes <- stringr::str_locate_all(string = line, pattern = '"')
cometes <- cometes[[1]] |>
dplyr::as_tibble() |>
dplyr::pull("start")
id <- stringr::str_locate(string = line, pattern = lab) |>
as.numeric()
id <- id[2]
idName <- cometes[cometes > id]
idName <- idName[1:2]
name <- substr(line, start = idName[1]+1, stop = idName[2]-1)
return(name)
}
for (k in seq_len(nrow(x))) {
nm <- x$ndorms_id[k]
content <- readLines(paste0(web, nm, "/"))
line <- content[grepl("og:title", content)]
name <- getLab(line, '"og:title"')
position <- getLab(line, '"og:description"') |>
stringr::str_split(pattern = " - ") |>
unlist() |>
dplyr::nth(2)
idStart <- which(grepl('<div class="rich-text">', content)) + 1
description <- content[idStart]
if (length(description) == 0) {
description <- character()
} else {
description <- trimws(description)
if (description == "<p></p>") {
description <- character()
}
}
picture <- getLab(line, '"og:image"')
if (is.na(picture)) {
cat(paste0("### ", name, '\n\n'))
} else {
cat(paste0(
"### ", name, '<a href="', web, nm, '/"><img src="', picture,
'" align="right" alt="HTML tutorial" style="width:200px;
padding-left:20px; padding-bottom:20px;"></a>\n\n'
))
}
cat(paste0("**", position, "**\n\n"))
links <- c(
# github
"https://github.com/{x$github[k]}",
# email
"mailto:{x$email[k]}.ox.ac.uk"
# TO ADD twitter
# TO ADD linkedIn
) |>
purrr::map_chr(glue::glue)
icon <- c("github", "envelope")
'<a href="{links}" class="bi bi-{icon} profile_icon"></a>' |>
glue::glue() |>
cat()
if (length(description) == 0 & !is.na(picture)) {
cat('<br>\n<br>\n<br>\n<br>\n\n')
} else {
cat(paste0(description, "\n\n"))
}
}
```