Skip to content

Google.Shortener class

mstn edited this page Jul 14, 2012 · 12 revisions

class: Google.Shortener location: MSMUtil.js

Access Google service to shorten urls. See also Google Documentation.

Usage example

var shortener = new Google.Shortener({ \n appid: /* PUT HERE YOUR GOOGLE API KEY */ \n }).failure(function(response){ /* CALLBACK METHOD IF SOMETHING WENT WRONG */ }); }); // async method to shorten urls shortener.shorten( /* YOUR VERY LONG URL */, function(response){ /* response.id contains your short URL */ });

Clone this wiki locally