Skip to content

Commit

Permalink
first version of displaying all data, need to be slim a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
defuneste committed May 28, 2024
1 parent 2af8120 commit 9225cc8
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions nbm_data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,29 @@ release <- get_release(filing_url)
table_with_options(release)
```

## Getting links for every CSV in NBM:

Even if NBM have a biannual release cycle it is updated more frequently (around every two weeks).

```{r}
#| label: list all available data
```{R}
#| eval: FALSE
get_data_url <- paste0("https://broadbandmap.fcc.gov/nbm/map/api/",
"national_map_process/nbm_get_data_download/")
get_csv_to_dl <- function(release_file, release_nb) {
get_data_url_last <- paste0(get_data_url,
get_data_url <- paste0(get_data_url,
release_file[release_nb, "process_uuid"])
test <- curl_fetch_memory(get_data_url_last)
raw_dat <- curl::curl_fetch_memory(get_data_url)
csv_to_dl <- jsonlite::fromJSON(rawToChar(test$content))$data
csv_to_dl <- jsonlite::fromJSON(rawToChar(raw_dat$content))$data
csv_to_dl[["release"]] <- release_file[release_nb, "filing_subtype"]
return(csv_to_dl)
}
big_list <- lapply(1:4, get_csv_to_dl, release_file = release)
big_list <- lapply(1:nrow(release), get_csv_to_dl, release_file = release)
bob <- do.call(rbind, big_list)
all_data <- do.call(rbind, big_list)
table_with_options(all_data)
```

0 comments on commit 9225cc8

Please sign in to comment.