check_input_weather <- function(start, end, user, password) {
check <- ArgumentCheck::newArgCheck()
# Check start and end are valid dates
check <- check_start_end_dates(check, start, end)
# Test access to IAC website
url <- "https://iacweb.ethz.ch/data/meteostation/chn/IAC-Met_2017-09-04.dat"
response <- httr::GET(
url = url,
httr::accept_json(),
httr::authenticate(user = user, password = password)
)
# Check if correct user and password
if (response$status != 200) {
ArgumentCheck::addError(
msg = "Invalid IAC username or password",
argcheck = check
)
}
#* Return errors and warnings (if any)
return(ArgumentCheck::finishArgCheck(check))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.