# library(DBI)
# library(RSQLite)
# library(tidyverse)
# library(rvest)
# library(httr)
# library(dbplyr)
zips <- 'zip location'
fdicBuild <- function(dbName){
page <- rvest::html('https://www5.fdic.gov/sdi/download_large_list_outside.asp')
onClickURL <- 'https://www5.fdic.gov/sdi/'
downloads <- page %>%
rvest::html_nodes('a') %>%
stringr::str_subset('\\.zip')
downloads1 <- stringr::str_match(downloads,
'<a href=\\\"(.+\\d{8}\\.zip)\\\">(All_Reports_\\d{8})\\.zip<\\/a>')
#2007 has an extra "quarter" - 2007123 -- seems like error in data input from fdic
downloads1 <- na.omit(downloads1)
#downloads1 <- downloads1[1:2,]
dir.create(zips)
lapply(1:nrow(downloads1),function(i){
download.file(paste(onClickURL,downloads1[i,2],
sep = ""),
file.path(zips,paste0(downloads1[i,3],".zip")))
})
writeFun(dbName)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.