Learn R Programming

urlshorteneR (version 0.9.2)

googl_LinksExpand: Expand a short URL to a longer one

Description

For the given short URL, the url.get method returns the corresponding long URL and the status.

Usage

googl_LinksExpand(shortUrl = "", projection = "FULL",
  showRequestURL = FALSE)

Arguments

shortUrl

- The short URL, including the protocol.

projection

- "FULL" - returns the creation timestamp and all available analytics (default) OR "ANALYTICS_CLICKS" - returns only click counts OR "ANALYTICS_TOP_STRINGS" - returns only top string counts (e.g. referrers, countries, etc)

showRequestURL

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

Value

id - is the short URL you passed in.

longUrl - is the long URL to which it expands. Note that longUrl may not be present in the response, for example, if status is "REMOVED".

status - is "OK" for most URLs. If Google believes that the URL is fishy, status may be something else, such as "MALWARE".

Quotas

By default, your registered project gets 1,000,000 requests per day for the URL Shortener API (https://console.developers.google.com/)

See Also

See https://developers.google.com/url-shortener/v1/getting_started#shorten

See https://developers.google.com/url-shortener/v1/url/get

Examples

Run this code
# NOT RUN {
googl_token <- googl_auth(key = "", secret = "")
g1 <- googl_LinksExpand(shortUrl = "http://goo.gl/vM0w4",showRequestURL = TRUE)
g4 <- googl_LinksExpand(shortUrl="http://goo.gl/vM0w4",projection = "ANALYTICS_TOP_STRINGS")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab