-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMauricio_slack_script.R
24 lines (20 loc) · 1.07 KB
/
Mauricio_slack_script.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
library(tidyverse)
library(devtools)
install_github("KTH-Library/swecris", dependencies = TRUE)
library(swecris)
library(dplyr)
#I modified the following function from swecris, and removed the search string that specified KTH
#kth_projects <- swecris_funding()
swecris_all_university_projects <- function (searchstring = "",
token)
{
if (missing(token))
token <- "RWNDZ3FDRVVSMmNUNlZkMkN3"
httr::GET("https://swecris-api.vr.se/v1/scp/export", query = list(`organizationType[]` = "Universitet",
sortOrder = "desc", sortColumn = "FundingStartDate",
searchText = URLencode(searchstring), token = token)) %>%
httr::content(as = "text", encoding = "UTF-8") %>% readr::read_delim(delim = ";",
quote = "\"", show_col_types = FALSE)
}
#get the data to an object
all_university_projects <- swecris_all_university_projects()