# Import Data
p <- read_csv("2021-09-01_2021-10-01-project.csv", col_types = cols())
t <- read_csv("2021-09-01_2021-10-01-time.csv", col_types = cols())
ts <- fromJSON(file = "2021-09-01_2021-10-01-timesheet.json")
# View(ts)

apps <- ts[["history"]][["apps"]] %>% tibble() %>% unnest_wider(col = ".")

activities <- ts[["history"]][["activities"]] %>% tibble() %>% unnest_wider(col = ".")

log <- ts[["history"]][["log"]] %>% tibble() %>% unnest_wider(col = ".")

categories <- ts[["history"]][["categories"]] %>% tibble %>% unnest_wider(col = ".")

activity_top <- ts[["totals"]][["activity_top"]] %>% tibble() %>% unnest_wider(col = ".")
category_top <- ts[["totals"]][["category_top"]] %>% tibble() %>% unnest_wider(col = ".")

distracting_duration <- ts[["totals"]][["distracting_duration"]]
neutral_duration <- ts[["totals"]][["neutral_duration"]]
productive_duration <- ts[["totals"]][["productive_duration"]]

durations <- tibble(
  distracting_duration = distracting_duration,
  neutral_duration = neutral_duration,
  productive_duration = productive_duration
)
apps
activities
log
categories
activity_top
category_top
durations