googl_LinksShorten: Given a long URL, returns a short Goo.gl link.

Description Usage Arguments Value See Also Examples

View source: R/googl_links.R

Description

Given a full URL, returns an goo.gl short URL. The returned resource contains the short URL and the long URL. Note that the returned long URL may be loosely canonicalized, e.g. to convert "google.com" into "http://google.com/". See the Authentication googl_auth section for more details.

Usage

1
googl_LinksShorten(longUrl = "", showRequestURL = FALSE)

Arguments

longUrl

- a long URL to be shortened (example: http://betaworks.com/).

showRequestURL

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

Value

id is the short URL that expands to the long URL you provided. If your request includes an auth token, then this URL will be unique. If not, then it might be reused from a previous request to shorten the same URL.

longURL - longUrl is the long URL to which it expands. In most cases, this will be the same as the URL you provided. In some cases, the server may canonicalize the URL. For instance, if you pass http://www.google.com, the server will add a trailing slash.

See Also

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

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

See http://stackoverflow.com/a/13168073

Examples

1
2
3
4
5
## Not run: 
googl_token <- googl_auth(key = "", secret = "")
g2 <- googl_LinksShorten(longUrl = "https://developers.google.com/url-shortener/v1/url/insert")

## End(Not run)

urlshorteneR documentation built on May 29, 2017, 3:48 p.m.