Installation
npm install -g goo.gl
Command-line Usage
$ goo.gl www.google.comhttp://www.google.com -> http://goo.gl/fbsS $ goo.gl http://goo.gl/fbsShttp://goo.gl/fbsS -> http://www.google.com/ $ goo.gl www.google.com http://goo.gl/fbsS nba.comhttp://goo.gl/fbsS -> http://www.google.com/http://www.google.com -> http://goo.gl/fbsShttp://nba.com -> http://goo.gl/d1T8 $ goo.gl --key aBcDeFGhIjKLMnOPqRsT www.spotify.comhttp://www.spotify.com/ -> http://goo.gl/cJFAL
It'll shorten and/or expand one or more URLs at a time.
Module Usage
Most methods return promises.
var googl = ; // Set a developer key (_required by Google_; see http://goo.gl/4DvFk for more info.)googl; // Get currently set developer keygoogl; // Shorten a long url and output the resultgoogl ; // Expand a goo.gl url and output the resultgoogl ; // Expand a goo.gl url and pass userIp for capping purposesgoogl ; // Shorten a goo.gl url and pass quotaUser for capping purposes// See: https://developers.google.com/console/help/#cappingusagegoogl ; // Look up a short URL's analytics// See: https://developers.google.com/url-shortener/v1/getting_started#url_analyticsgoogl ; googl ; googl ; //default to projection=FULLgoogl ;