bitly_shorten_link: Shorten a Link

View source: R/bitly_links.R

bitly_shorten_linkR Documentation

Shorten a Link

Description

See https://dev.bitly.com/api-reference/#createBitlink Convert a long url to a Bitlink

Usage

bitly_shorten_link(
  domain = "bit.ly",
  group_guid = NULL,
  long_url = NULL,
  showRequestURL = FALSE
)

Arguments

domain

- (optional) the short domain to use; either bit.ly, j.mp, or bitly.com or a custom short domain. The default for this parameter is the short domain selected by each user in their bitly account settings. Passing a specific domain via this parameter will override the default settings.

group_guid

- a GUID for a Bitly group

long_url

- required, a long URL to be shortened (example: https://www.idnes.cz). Must contain http/https

showRequestURL

- show URL which has been build and requested from server. For debug purposes.

Examples

## Not run: 
bitly_shorten_link(url = "http://www.seznam.cz/")
bitly_shorten_link(url = "http://www.seznam.cz/", showRequestURL = TRUE)

manyUrls <- list(
  "http://www.seznam.cz/", "http://www.seznamasdas.cz/",
  "http://www.seznam.cz/asadasd", "http://www.seznam.cz/adqwrewtregt"
)
for (u in 1:length(manyUrls)) {
  print(bitly_shorten_link(long_url = manyUrls[[u]], showRequestURL = TRUE))
}

## End(Not run)

dmpe/urlshorteneR documentation built on Aug. 23, 2022, 1:12 a.m.