Skip to content

Google.Shortener class

mstn edited this page Jul 14, 2012 · 12 revisions

Class: Google.Shortener

location: MSMUtil.js

requires: Ext Js

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

Usage example

var shortener = new Google.Shortener({ 
		    appid: /* PUT HERE YOUR GOOGLE API KEY */ 
		}).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