Skip to content

Commit

Permalink
adding a way to display available data from NBM
Browse files Browse the repository at this point in the history
  • Loading branch information
defuneste committed May 28, 2024
1 parent 0709a3f commit 2af8120
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
any::DT
any::ggplot2
any::remotes
any::curl
any::jsonlite
- name: Install package from GH
run: |
Expand Down
3 changes: 2 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ website:
search: true
contents:
- section: "FCC Data"
contents:
contents:
- nbm_data.qmd
- FCC_provider_list.qmd
- isp_eda.qmd
- fcc_funding.qmd
Expand Down
53 changes: 53 additions & 0 deletions nbm_data.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: "FCC NBM data"
date: last-modified
format:
html:
code-fold: true
engine: knitr
---

```{r}
#| label: utility functions
source("R/table_with_options.R")
```

This page will display all available data that can downloaded from FCC NBM.

## Getting the Information about NBM Release:

```{r}
#| label: setting URL and getting a table with release
filing_url <- "https://broadbandmap.fcc.gov/nbm/map/api/published/filing"
# getting a list of release
get_release <- function(filing_url) {
req <- curl::curl_fetch_memory(filing_url)
release <- jsonlite::fromJSON(rawToChar(req$content))$data
return(release)
}
release <- get_release(filing_url)
table_with_options(release)
```



```{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,
release_file[release_nb, "process_uuid"])
test <- curl_fetch_memory(get_data_url_last)
csv_to_dl <- jsonlite::fromJSON(rawToChar(test$content))$data
return(csv_to_dl)
}
big_list <- lapply(1:4, get_csv_to_dl, release_file = release)
bob <- do.call(rbind, big_list)
```

0 comments on commit 2af8120

Please sign in to comment.