CmdUtils CreateCommand name tinyurl takes url to shorten noun_arb_text

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CmdUtils.CreateCommand({
name: "tinyurl",
takes: {"url to shorten": noun_arb_text},
preview: "Replaces the selected URL with a TinyUrl.",
execute: function( urlToShorten ) {
var baseUrl = "http://tinyurl.com/api-create.php";
var params = {url: urlToShorten.text};
jQuery.get( baseUrl, params, function( tinyUrl ) {
CmdUtils.setSelection( tinyUrl );
})
}
})