From 52be07f5370f5c8558331d4a04fde3e8c2efa48a Mon Sep 17 00:00:00 2001 From: Sam Albers Date: Thu, 3 Oct 2024 20:43:10 -0700 Subject: [PATCH] last one? --- R/zzz.R | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/R/zzz.R b/R/zzz.R index 5aae172..a64bf81 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -18,13 +18,12 @@ packageStartupMessage(info("Checking for a new version of HYDAT...")) base_url <- "http://collaboration.cmc.ec.gc.ca/cmc/hydrometrics/www/" - x <- httr::GET(base_url) - httr::stop_for_status(x) - + x <- tidyhydat_realtime_csv_parser(base_url) + ## Extract newest HYDAT new_hydat <- as.Date(substr(gsub( "^.*\\Hydat_sqlite3_", "", - httr::content(x, "text") + x ), 1, 8), "%Y%m%d") ## Compare that to existing HYDAT