Learn R Programming

urlshorteneR (version 0.9.2)

bitly_LinksInfo: Used to return the page title for a given Bitlink.

Description

See http://dev.bitly.com/links.html#v3_info

Usage

bitly_LinksInfo(hashIN = NULL, shortUrl = NULL, expand_user = "true",
  showRequestURL = FALSE)

Arguments

hashIN

- refers to one bitly hashes, (e.g.: 2bYgqR or a-custom-name). Required

shortUrl

- refers to one Bitlinks e.g.: http://bit.ly/1RmnUT or http://j.mp/1RmnUT. Optional.

expand_user

- optional true|false (default) - include extra user info in response.

showRequestURL

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

Value

short_url - this is an echo back of the shortUrl request parameter.

hash - this is an echo back of the hash request parameter.

user_hash - the corresponding bitly user identifier.

global_hash - the corresponding bitly aggregate identifier.

error - indicates there was an error retrieving data for a given shortUrl or hash. An example error is "NOT_FOUND".

title - the HTML page title for the destination page (when available).

created_by - the bitly username that originally shortened this link, if the link is public. Otherwise, null.

created_at - the epoch timestamp when this Bitlink was created.

Examples

Run this code
# NOT RUN {
bitly_token <- bitly_auth(key = "be03aead58f23bc1aee6e1d7b7a1d99d62f0ede8", 
secret = "b7e4abaf8b26ec4daa92b1e64502736f5cd78899")
bitly_LinksInfo(shortUrl = "http://bit.ly/DPetrov")
bitly_LinksInfo(hash = "DPetrov", showRequestURL = TRUE) 
bitly_LinksInfo(hash = "DPetrov", expand_user = "true")

## hash is the one which is only returned. Dont use
bitly_LinksInfo(shortUrl = "on.natgeo.com/1bEVhwE", hash = "DPetrov") 

## manyHashes <- list("DPetrov", "1QU8CFm", "1R1LPSE", "1LNqqva")
## for (u in 1:length(manyHashes)) {
##   print(bitly_LinksInfo(hashIN = manyHashes[[u]], showRequestURL = TRUE))
## }
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab