-
Notifications
You must be signed in to change notification settings - Fork 2
/
add_schedules.R
26 lines (21 loc) · 958 Bytes
/
add_schedules.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
25
26
library(cfbfastR)
library(dplyr)
library(arrow)
library(purrr)
library(glue)
games <- purrr::map_dfr(
2001:cfbfastR:::most_recent_cfb_season(),
function(x){
games <- cfbfastR::cfbd_game_info(x)
readr::write_csv(games, glue::glue("schedules/csv/cfb_schedules_{x}.csv"))
saveRDS(games, glue::glue("schedules/rds/cfb_schedules_{x}.rds"))
arrow::write_parquet(games,glue::glue("schedules/parquet/cfb_schedules_{x}.parquet"))
arrow::write_parquet(games,glue::glue("schedules/parquet/schedules_{x}.parquet"))
})
message <- sprintf("Updated %s (ET) using cfbfastR version %s", lubridate::now("America/New_York"), utils::packageVersion("cfbfastR"))
system(glue::glue('git config --local user.email "[email protected]" '))
system(glue::glue('git config --local user.name "GitHub Actions"'))
system(glue::glue('git add .'))
system(glue::glue('git commit -am "{message}"'))
system(glue::glue('git pull'))
system(glue::glue('git push'))