Learn R Programming

longurl (version 0.2.0)

expand_urls: Expand a vector of (short) URLs using the URL-Expander service

Description

Pass in a vector of URLs (ostensibly "short" URLs) and receive a data_frame of the original URLs and expanded URLs via the 'URL-Expander' service.

Usage

expand_urls(urls_to_expand, check = FALSE, warn = TRUE, .progress = interactive())

Arguments

urls_to_expand
character vector of URLs
check
run an extra HEAD request on the expanded URL to determine validity. This is an expensive operation, so recommended usage is to run this only on URLs that did not seem to expand.
warn
show any warnings (API or otherwise) as messages
.progress
display a progress bar (generally only useful in interactive sesions)

Value

data_frame (compatible with data.frame) of results with the orignial URLs in orig_url and expanded URLs in expanded_url)

Examples

Run this code
test_urls <- c("http://t.co/D4C7aWYIiA",
               "1.usa.gov/1J6GNoW",
               "ift.tt/1L2Llfr")
big_urls <- expand_urls(test_urls)
head(big_urls)

Run the code above in your browser using DataLab