Skip to content

Commit

Permalink
last one?
Browse files Browse the repository at this point in the history
  • Loading branch information
boshek committed Oct 4, 2024
1 parent 4e3a4ab commit 52be07f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52be07f

Please sign in to comment.