R/check_search_fields.R

# Check that the search fields are recognized by the Internet Archive API
#
# @param The named character vector of search fields and values.
# @references The list of valid search terms is drawn from the Internet Archive
# \href{https://archive.org/advancedsearch.php}{advanced search page}.
check_search_fields <- function(terms) {
  diff <- setdiff(names(terms), ia_fields)
  if (length(diff) > 0) {
    diff <- paste(diff, collapse = ", ")
    stop(paste("The search field(s)", diff, "is/are not valid."))
  }
}

Try the internetarchive package in your browser

Any scripts or data that you put into this service are public.

internetarchive documentation built on May 2, 2019, 3:01 a.m.