Skip to content

Instantly share code, notes, and snippets.

/x

Created March 9, 2009 15:45
Show Gist options
  • Save anonymous/76348 to your computer and use it in GitHub Desktop.
Save anonymous/76348 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "tinyarrow",
takes: {"url to shorten": noun_type_url},
icon: "http://tinyarro.ws/favicon.ico",
description: "Replaces the selected URL with a <a href=\"http://tinyarro.ws\">TinyArrow (&#x27A1;.ws) URL</a>",
execute: function( urlToShorten ) {
//escaping urlToShorten will not create the right tinyurl
var baseUrl = "http://tinyarro.ws/api-create.php?url=";
jQuery.get( baseUrl + urlToShorten.text, function( tinyArrow ) {
CmdUtils.setSelection( tinyArrow );
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment