-
Notifications
You must be signed in to change notification settings - Fork 1
/
2023-summer-tour.R
86 lines (78 loc) · 2.25 KB
/
2023-summer-tour.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
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
source("src/print-post.R")
source("src/update-google-sheet.R")
source("src/update-website-data.R")
library(tidyverse)
league_ids <- list(
"NA" = 15350,
"SA" = 15365,
"WEU" = 15351,
"EEU" = 15335,
"CN" = 15383,
"SEA" = 15374
)
period_dates <- list(
"period_1" = list(
"start_time" = as.POSIXct("2023-05-15 07:00", tz = "UTC") %>% as.integer(),
"end_time" = as.POSIXct("2023-05-22 07:00", tz = "UTC") %>% as.integer()
),
"period_2" = list(
"start_time" = as.POSIXct("2023-05-22 07:00", tz = "UTC") %>% as.integer(),
"end_time" = as.POSIXct("2023-05-29 07:00", tz = "UTC") %>% as.integer()
),
"period_3" = list(
"start_time" = as.POSIXct("2023-05-29 07:00", tz = "UTC") %>% as.integer(),
"end_time" = as.POSIXct("2023-06-05 07:00", tz = "UTC") %>% as.integer()
)
)
# Update Google Sheet
lapply(names(league_ids), function(league_name) {
update_google_sheet(
google_sheet = "11ExiDnIYbupgsjuSbr9zeaBTXb_xn2N9uyvyD0Gz1bc",
work_sheet = league_name,
league_id = league_ids[[league_name]],
exponential = TRUE,
update = FALSE
)
})
# Update website
lapply(names(league_ids), function(league_name) {
update_website_data(
league_id = league_ids[[league_name]],
period_dates = period_dates,
update = FALSE
)
})
# Create Reddit post
## Period 1
print_post(
league_ids = league_ids,
start_time = period_dates$period_1$start_time,
end_time = period_dates$period_1$end_time,
google_sheet = "11ExiDnIYbupgsjuSbr9zeaBTXb_xn2N9uyvyD0Gz1bc",
file_path = "data/posts/2023_summer_tour_p1.txt",
innate_data_only = FALSE,
exponential = TRUE,
update = FALSE
)
## Period 2
print_post(
league_ids = league_ids,
start_time = period_dates$period_2$start_time,
end_time = period_dates$period_2$end_time,
google_sheet = "11ExiDnIYbupgsjuSbr9zeaBTXb_xn2N9uyvyD0Gz1bc",
file_path = "data/posts/2023_summer_tour_p2.txt",
innate_data_only = FALSE,
exponential = TRUE,
update = FALSE
)
## Period 3
print_post(
league_ids = league_ids,
start_time = period_dates$period_3$start_time,
end_time = period_dates$period_3$end_time,
google_sheet = "11ExiDnIYbupgsjuSbr9zeaBTXb_xn2N9uyvyD0Gz1bc",
file_path = "data/posts/2023_summer_tour_p3.txt",
innate_data_only = FALSE,
exponential = TRUE,
update = FALSE
)