Skip to content

Commit

Permalink
Progress bar is now optional
Browse files Browse the repository at this point in the history
  • Loading branch information
andodet committed Jun 4, 2020
1 parent 6db0ef1 commit 0a340cf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions R/get_mob_idx.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,22 @@
get_mob_idx <- function(start_date = "2020-01-01",
end_date = Sys.Date(),
city = NA,
weekly = FALSE) {
weekly = FALSE,
verbose = FALSE) {

# Add progress bar if verbose
if (verbose) {
prog_bar <- httr::progress(type = "down", con = stdout())
} else {
prog_bar <- NULL
}

# Get data from Citymapper's API
res <- httr::RETRY(
"GET",
url = 'https://citymapper.com/api/gobot_tab/data',
add_headers("https://github.com/andodet/citymappR/"),
httr::progress(type = "down", con = stdout())
prog_bar
) %>%
content()

Expand Down

0 comments on commit 0a340cf

Please sign in to comment.