tomjadams (owner)

Fork Of

gist: 7616 by al3x Ubiquity commands for bit.l...

Revisions

gist: 7644 Download_button fork
public
Public Clone URL: git://gist.github.com/7644.git
Embed All Files: show embed
JavaScript #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
    })
  }
})