Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Ubiquity Command that uses to shorten urls
* Command to shorten URLs using
* Copied from
name: "bitly",
takes: {"url to shorten": noun_arb_text},
icon: "",
description: "Replaces the selected URL with a shortened version from <a href=\"\"></a><br/>And copies it to your clipboard for further use",
license: "MPL",
preview: function( pblock, urlToShorten ){
pblock.innerHTML = "Replaces the selected URL with a shorted version using"<br>""
+ urlToShorten ;
execute: function( urlToShorten ) {
jQuery.get( "" + urlToShorten.text, function( bitly ) {
CmdUtils.setSelection( bitly );
var gClipboardHelper = Components.classes[";1"].getService(Components.interfaces.nsIClipboardHelper);
gClipboardHelper.copyString(bitly );
displayMessage(bitly + " copied to the clipboard");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment