Learn R Programming

urlshorteneR (version 2.0.0)

bitly_expand_link: Expand a Bitlink

Description

See https://dev.bitly.com/api-reference/#expandBitlink This endpoint returns public information for a Bitlink.

Usage

bitly_expand_link(
  bitlink_id = NULL,
  access_token = NULL,
  showRequestURL = FALSE
)

Value

long_url - a full URL to which bitlink points to

Arguments

bitlink_id

- string

access_token

- bearer token which might be also provided directly

showRequestURL

- an optional T/F value to whether show URL which has been build and requested from server. For debug purposes, default FALSE.

Examples

Run this code
if (FALSE) {
bitly_bearerToken("access token")
bitly_expand_link(bitlink_id = "bit.ly/DPetrov")
bitly_expand_link(bitlink_id = "on.natgeo.com/1bEVhwE")

## manyHashes <- list("bit.ly/DPetrov", "bit.ly/1QU8CFm", "bit.ly/1R1LPSE", "bit.ly/1LNqqva")
## for (u in 1:length(manyHashes)) {
##   print(bitly_expand_link(bitlink_id = manyHashes[[u]], showRequestURL = TRUE))
## }
}

Run the code above in your browser using DataLab