knitr::opts_chunk$set(collapse=TRUE, fig.retina=2, message=FALSE, warning=FALSE, out.width="100%")
options(width=120)

Travis-CI Build Status Coverage Status CRAN_Status_Badge

wiglr

Query and Submit Wi-Fi and Cellular Network Information on 'WiGLE'

Description

'WiGLE' consolidates location and information of wireless networks world-wide to a central database, and has both a user-friendly desktop+web application plus rich API that can map, query and update the location database. Non-commerical use of the data is bound by the 'WiGLE' EULA https://wigle.net/eula.html. Use of the API requires a 'WiGLE' API key https://wigle.net/account.

What's Inside The Tin

The following functions are implemented:

Installation

devtools::install_git("https://sr.ht.com/~hrbrmstr/wiglr.git")
# or
devtools::install_git("https://gitlab.com/hrbrmstr/wiglr.git")
# or (if you must)
devtools::install_github("hrbrmstr/wiglr")

Usage

library(wiglr)
library(hrbrthemes)
library(tidyverse) # for show
# current version
packageVersion("wiglr")

Country Stats

cc <- wigle_country_stats()
top_n(cc, 20) %>%  # show top 20 
  mutate(country = factor(country, levels = rev(country))) %>% 
  ggplot(aes(count, country)) +
  geom_segment(aes(xend=0, yend=country), size = 6, color = ft_cols$blue) +
  scale_x_comma(position = "top") +
  labs(
    x = "# Networks", y = NULL,
    title = "WiGLE Top 20 Countries"
  ) +
  theme_ipsum_rc(grid = "X")

Bounding-box Search (WIP)

Not all the parameters are supported yet and you must paginate on your own for now.

wifi_box <- wigle_bbox_search(43.2468, 43.2806, -70.9282, -70.8025)

We received 100 records out of totalResults of r wifi_box$totalResults. Use search_after in subsequent calls to get the next page. The results slot holds the data.

knitr::kable(
  head(wifi_box$results, 20)
)

Map them!

ggplot(wifi_box$results, aes(trilong, trilat)) + 
  geom_point() +
  ggrepel::geom_label_repel(
    aes(label = ssid), size = 2, family = font_rc
  ) + 
  coord_quickmap() +
  labs(
    x = NULL, y = NULL,
    title = "WiGLE Quickmap of First 100 Results"
  ) +
  theme_ipsum_rc(grid = "XY")

Make your own WiGLE interactive map by running this at home:

library(leaflet)

wifi_box$results %>% 
  mutate(labs = sprintf("SSID: <code>%s</code><br/>Encryption: %s", ssid, encryption)) %>% 
  leaflet() %>% 
  addTiles() %>% 
  addCircleMarkers(~trilong, ~trilat, radius = 1, popup = ~labs)

wiglr Metrics

cloc::cloc_pkg_md()

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



hrbrmstr/wiglr documentation built on May 18, 2019, 12:26 p.m.