Skip to content

Commit

Permalink
refactor scraping function for climate data urls
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Aug 4, 2024
1 parent bd548dd commit 2510fbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/pagasa_climate.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ climate_get_pdf_directory_urls <- function(.url = "https://pubfiles.pagasa.dost.

rvest::html_elements(pagasa_session, css = "pre a") |>
rvest::html_text() |>
(\(x) x[stringr::str_detect(string = x, pattern = "\\.\\.\\/|Bulletin", negate = TRUE)])() |>
(\(x) x[stringr::str_detect(string = x, pattern = "CLIMATOLOGICAL")])() |>
(\(x) paste0(.url, x))() |>
stringr::str_replace_all(pattern = " ", replacement = "%20")
}
Expand Down

0 comments on commit 2510fbd

Please sign in to comment.