##-------------------------------------------------------------
##
##-------------------------------------------------------------
cran_mirror = function(url = "https://cran.r-project.org/mirrors.html")
{
# internet = curl::nslookup("www.r-project.org", ipv4_only = TRUE, error = FALSE)
#
# if(is.null(internet))
# {
# mensagem(msg = 6, aviso="Conection", subtitulo = "Sem acesso a internet")
# return(NULL)
# }#end if
txt = readLines(url)
idx = grep("http:|https:", txt)
a = txt[idx]
t1 = gsub(".*href=", "", a)
t2 = gsub(" target=.*", "", t1)
t3 = gsub('\\"', "", t2)
a1 = grep("[A-Z]", txt[-idx], value = T)
a2 = grep("<", a1)
a3 = a1[-a2]
a4 = a3[-c(1:3)]
cran = data.frame(URL = t3, Institution = a4, stringsAsFactors = FALSE)
return(cran)
}#end function cran_mirror
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.