Skip to content

Instantly share code, notes, and snippets.

@tomjadams
Forked from al3x/al3x_ubiquity.js
Created August 28, 2008 02:32
Show Gist options
  • Save tomjadams/7644 to your computer and use it in GitHub Desktop.
Save tomjadams/7644 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "showmore",
takes: {"url to shorten": noun_arb_text},
preview: "Replaces the selected URL with ashowmore.info shortened URL.",
description: "Replaces the selected URL with a bit.ly-shortened URL.",
icon: "http://bit.ly/favicon.png",
execute: function( urlToShorten ) {
var baseUrl = "http://showmore.info/links/";
var params = {link_url: urlToShorten.text};
jQuery.get(baseUrl, params, function(shortenedUrl) {
CmdUtils.setSelection(shortenedUrl);
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment