R/odcr_scrape_all.R

Defines functions odcr_scrape_all

odcr_scrape_all <- function(courts, casetypes, years, reverse = FALSE) {
  for (court_tmp in courts) {
    for (casetype_tmp in casetypes) {
      for (year_tmp in years) {
        lastcase <- oscn_lastcase(court_tmp, casetype_tmp, year_tmp)
        
        message(paste("Scraping", lastcase, casetype_tmp, "cases filed in", court_tmp, "in", year_tmp))
        
        if (reverse == FALSE) {
          odcr_scrape(court_tmp, casetype_tmp, year_tmp, 1:lastcase, update_freq = 20)
        } else {
          odcr_scrape(court_tmp, casetype_tmp, year_tmp, lastcase:1, update_freq = 20)
        }
      }
    }
  }
}
openjusticeok/ojo documentation built on Feb. 2, 2021, 5:47 a.m.