Learn R Programming

longurl (version 0.1.1)

expand_urls: Expand a vector of (short) URLs using the longurl 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 'LongURL' 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). Will return NA if there are severe issues connecting to the LongURL API.

Examples

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

Run the code above in your browser using DataLab