Skip to content

Commit

Permalink
Update URL check
Browse files Browse the repository at this point in the history
  • Loading branch information
hillarymarler committed Aug 28, 2024
1 parent 7fcdec4 commit 43af412
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/urlcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ jobs:
- name: Run URL check
run: |
Rscript -e "
urls <- c('https://github.com/USEPA/EPATADA/')
files <- list.files(pattern = '\\.R$', recursive = TRUE)
urls <- unlist(lapply(files, function(file) {
lines <- readLines(file)
urls <- grep('http[s]?://', lines, value = TRUE)
gsub('.*(http[s]?://[^ ]+).*', '\\1', urls)
}))
for (url in urls) {
status <- system(paste('curl -o /dev/null -s -w \"%{http_code}\"', url), intern = TRUE)
if (status != '200') {
stop(paste('URL check failed for', url))
}
}
"
"
4 changes: 2 additions & 2 deletions R/DataDiscoveryRetrieval.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#' @param countycode FIPS county name. Note that a state code must also be supplied (e.g. statecode = "AL", countycode = "Chilton"). See https://www.waterqualitydata.us/Codes/countycode for options.
#' @param huc A numeric code denoting a hydrologic unit. Example: "04030202". Different size hucs can be entered. See https://epa.maps.arcgis.com/home/item.html?id=796992f4588c401fabec7446ecc7a5a3 for a map with HUCS. Click on a HUC to find the associated code.
#' @param siteid Unique monitoring location identifier.
#' @param siteType Type of waterbody. See https://www.waterqualitydata.us/Codes/WRONGURL for options.
#' @param siteType Type of waterbody. See https://www.waterqualitydata.us/Codes/sitetype for options.
#' @param characteristicName Name of parameter. See https://www.waterqualitydata.us/Codes/characteristicName for options.
#' @param characteristicType Groups of environmental measurements/parameters. See https://www.waterqualitydata.us/Codes/characteristicType for options.
#' @param sampleMedia Sampling substrate such as water, air, or sediment. See https://www.waterqualitydata.us/Codes/sampleMedia for options.
Expand Down Expand Up @@ -440,7 +440,7 @@ TADA_ReadWQPWebServices <- function(webservice) {
#' @param huc A numeric code denoting a hydrologic unit. Example: "04030202". Different size hucs can be entered. See https://epa.maps.arcgis.com/home/item.html?id=796992f4588c401fabec7446ecc7a5a3 for a map with HUCS. Click on a HUC to find the associated code.
#' @param siteid Unique monitoring location identifier.
#' @param siteType Type of waterbody. See https://www.waterqualitydata.us/Codes/sitetype for options.
#' @param characteristicName Name of parameter. See https://www.waterqualitydata.us/Codes/characteristicName for options.
#' @param characteristicName Name of parameter. See https://www.waterqualitydata.us/Codes/WRONGURL for options.
#' @param characteristicType Groups of environmental measurements/parameters. See https://www.waterqualitydata.us/Codes/characteristicType for options.
#' @param sampleMedia Sampling substrate such as water, air, or sediment. See https://www.waterqualitydata.us/Codes/sampleMedia for options.
#' @param organization A string of letters and/or numbers (some additional characters also possible) used to signify an organization with data in the Water Quality Portal. See https://www.waterqualitydata.us/Codes/organization for options.
Expand Down

0 comments on commit 43af412

Please sign in to comment.