View source: R/utils-helpers.R
| mobdb_extract_urls | R Documentation |
Helper function to extract producer URLs from a tibble of feeds returned
by feeds() or mobdb_search(). This is useful when you want to
get all the source URLs from a set of search results.
mobdb_extract_urls(feeds)
feeds |
A tibble returned by |
A character vector of download URLs, with the same length as the
input tibble. Returns NA for feeds without a URL.
# Create sample data matching feeds() output structure
sample_feeds <- tibble::tibble(
id = c("mdb-1", "mdb-2"),
provider = c("Agency A", "Agency B"),
source_info = tibble::tibble(
producer_url = c("https://example.com/feed1.zip", "https://example.com/feed2.zip"),
authentication_type = c(0L, 0L)
)
)
# Extract URLs from sample data
mobdb_extract_urls(sample_feeds)
# With real API data:
ca_gtfs <- feeds(subdivision_name = "California", data_type = "gtfs")
ca_urls <- mobdb_extract_urls(ca_gtfs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.