diff --git a/.github/workflows/urlcheck.yml b/.github/workflows/urlcheck.yml index 5614ef4b..6b9cf398 100644 --- a/.github/workflows/urlcheck.yml +++ b/.github/workflows/urlcheck.yml @@ -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)) } } - " - + " \ No newline at end of file diff --git a/R/DataDiscoveryRetrieval.R b/R/DataDiscoveryRetrieval.R index 1d3967ce..ee1cff18 100644 --- a/R/DataDiscoveryRetrieval.R +++ b/R/DataDiscoveryRetrieval.R @@ -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. @@ -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.