@@ -26,7 +26,7 @@ get_unit_code <- function(unit) { # input must have quotes to indicate strings
2626 f <- file.path(tempdir(), " irmadownload.xml" )
2727 if (! file.exists(f )) {
2828 # access all park codes from NPS xml file
29- curl :: curl_download(" https://irmaservices.nps.gov/v2/rest/unit /" , f )
29+ curl :: curl_download(" https://irmaservices.nps.gov/unit/ v2/api /" , f )
3030 }
3131 result <- XML :: xmlParse(file = f ) # parse xml
3232 dat <- XML :: xmlToDataFrame(result )
@@ -55,7 +55,7 @@ get_park_code <- function(park) {
5555 f <- file.path(tempdir(), " irmadownload.xml" )
5656 if (! file.exists(f )) {
5757 # access all park codes from NPS xml file
58- curl :: curl_download(" https://irmaservices.nps.gov/v2/rest/unit /" , f )
58+ curl :: curl_download(" https://irmaservices.nps.gov/unit/ v2/api /" , f )
5959 }
6060 result <- XML :: xmlParse(file = f )
6161 dat <- XML :: xmlToDataFrame(result )
@@ -85,7 +85,7 @@ get_unit_code_info <- function(code) {
8585 f <- file.path(tempdir(), " irmadownload.xml" )
8686 if (! file.exists(f )) {
8787 # access all park codes from NPS xml file
88- curl :: curl_download(paste0(" https://irmaservices.nps.gov/v2/rest/unit /" , f ))
88+ curl :: curl_download(paste0(" https://irmaservices.nps.gov/unit/ v2/api /" , f ))
8989 }
9090 result <- XML :: xmlParse(file = f )
9191 dat <- XML :: xmlToDataFrame(result )
@@ -131,7 +131,7 @@ get_unit_info <- function(code = NULL,
131131 f <- file.path(tempdir(), " irmadownload.xml" )
132132 if (! file.exists(f )) {
133133 # access all park codes from NPS xml file
134- curl :: curl_download(" https://irmaservices.nps.gov/v2/rest/unit /" , f )
134+ curl :: curl_download(" https://irmaservices.nps.gov/unit/ v2/api /" , f )
135135 }
136136 result <- XML :: xmlParse(file = f )
137137 dat <- XML :: xmlToDataFrame(result )
0 commit comments