Skip to content

Commit

Permalink
Merge branch 'main' into dev/nbm
Browse files Browse the repository at this point in the history
  • Loading branch information
defuneste authored Oct 4, 2024
2 parents bd8de0f + 4a968b6 commit 2334a51
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 20 deletions.
25 changes: 18 additions & 7 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
^Makefile$
^\.DS_Store$
^\.git$
^\.github$
^\.gitignore$
^\.idea$
^\.Renviron$
^\.Rprofile$
^\.quarto$
^\.ssh$
^\.viminfo$
^\.vscode$
^.*\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
^_targets$
^LICENSE\.md$
^Makefile$
^codecov\.yml$
^data-raw$
^_pkgdown\.yml$
^data_swamp$
^docs$
^pkgdown$
^README\.Rmd$
^codecov\.yml$
^\.github$
^vignettes/articles$
^.*\.Rproj$
^\.Rproj\.user$
^data_swamp$
5 changes: 3 additions & 2 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ user_agent <- function() {
#' @examples
#' \dontrun{
#' set_user_agent(
#' paste0("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36",
#' " (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36")
#' paste0("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36",
#' " (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36")
#' )
#' }

set_user_agent <- function(user_agent) {
Expand Down
14 changes: 12 additions & 2 deletions R/get_nbm_available.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#'
#' @examples
#' nbm_data <- get_nbm_available()
#' head(nbm_data)

get_nbm_available <- function(
get_data_url = paste0("https://broadbandmap.fcc.gov/nbm/map/",
Expand All @@ -30,8 +31,17 @@ get_nbm_available <- function(
# csv_to_dl <- jsonlite::fromJSON(rawToChar(raw_dat$content))$data

res <- system(
sprintf("curl '%s' --compressed -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: none' -H 'Sec-Fetch-User: ?1' -H 'Sec-GPC: 1' -H 'Priority: u=0, i' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers'",
get_data_url),
sprintf(
paste0("curl '%s' --compressed ",
"-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0' ",
"-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8' ",
"-H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' ",
"-H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' ",
"-H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: none' -H 'Sec-Fetch-User: ?1' ",
"-H 'Sec-GPC: 1' -H 'Priority: u=0, i' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers'"
),
get_data_url
),
intern = TRUE)
csv_to_dl <- jsonlite::fromJSON(res)[["data"]]

Expand Down
13 changes: 11 additions & 2 deletions R/get_nbm_release.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@ get_nbm_release <- function(filing_url = "https://broadbandmap.fcc.gov/nbm/map/a
# release <- jsonlite::fromJSON(rawToChar(req$content))$data

res <- system(
sprintf("curl '%s' --compressed -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: none' -H 'Sec-Fetch-User: ?1' -H 'Sec-GPC: 1' -H 'Priority: u=0, i' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers'",
filing_url),
sprintf(
paste0("curl '%s' --compressed ",
"-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0' ",
"-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8' ",
"-H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' ",
"-H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' ",
"-H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: none' -H 'Sec-Fetch-User: ?1' ",
"-H 'Sec-GPC: 1' -H 'Priority: u=0, i' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers'"
),
filing_url
),
intern = TRUE)
release <- jsonlite::fromJSON(res)[["data"]]

Expand Down
8 changes: 5 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/ruralinnovation/cori.data.fcc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ruralinnovation/cori.data.fcc/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of cori.data.fcc is to facilate the discovery, the download and uses of FCC's data.
The goal of cori.data.fcc is to facilitate the discovery, download and use of FCC public data releases.

It covers:

- National Broadband Map [(NBM)](https://broadbandmap.fcc.gov/home) data
- [Form 477](https://www.fcc.gov/general/broadband-deployment-data-fcc-form-477) data
- National Broadband Map [(NBM)](https://broadbandmap.fcc.gov/home) data[^bdc]
- [Form 477](https://www.fcc.gov/general/broadband-deployment-data-fcc-form-477) data

[^bdc]: This is data about internet services available to individual locations across the country, along with new maps of mobile coverage, as reported by Internet Service Providers (ISPs) as part of the FCC’s ongoing [Broadband Data Collection](https://broadbandmap.fcc.gov/data-download/nationwide-data)).

## Installation

Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ reference:
- get_frn_nbm_bl
- get_nbm_release
- get_nbm_available
- dl_nbm
- dl_nbm

- title: Form 477
contents:
Expand Down
1 change: 1 addition & 0 deletions man/get_nbm_available.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/set_user_agent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vignettes/articles/MBM.Rmd → vignettes/articles/NBM.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
title: "National Broadband Map (NBM)"
output: rmarkdown::html_vignette
code_folding: hide
vignette: >
%\VignetteIndexEntry{National Broadband Map (NBM)}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/f477.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "FCC's Form 477"
output: rmarkdown::html_vignette
code_folding: hide
vignette: >
%\VignetteIndexEntry{FCC's Form 477"}
%\VignetteIndexEntry{FCC's Form 477}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down

0 comments on commit 2334a51

Please sign in to comment.