R/utils.r

Defines functions check_api

CENSYS_API_URL <- "https://www.censys.io/api/v1/"

check_api <- function() {

  id <- Sys.getenv("CENSYS_API_ID")
  secret <- Sys.getenv("CENSYS_API_SECRET")

  if (id == "" | secret == "") {
    stop("Both CENSYS_API_ID and CENSYS_API_SECRET must be present in the R environment.")
  }

  return(httr::authenticate(id, secret))

}

Try the censys package in your browser

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

censys documentation built on May 2, 2019, 10:45 a.m.