R/guess_domain.R

Defines functions guess_domain

Documented in guess_domain

#' function guessing domain from path
#' @param x path aka URL from which to infer domain
guess_domain <- function(x){

    if(length(x)>1){
    return(
      unlist(
        lapply(
          X   = x,
          FUN = guess_domain
        )
      )
    )

  } else {

    domain <- parse_url(url = x)$domain

    if( is.null(domain) ){
      domain <- NA
    }

    return(domain)
  }

}

Try the robotstxt package in your browser

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

robotstxt documentation built on Sept. 4, 2020, 1:08 a.m.