Ubiquity

Note: To install this command, simply return to this page after you have installed Ubiquity and you will be prompted to install the command.

After installing the Ubiquity addon for Firefox, i became so hooked that I decided to write my own ubiquity command for Tcp3.

The TCP3 command allows you to parse selected text in a text box and substitute short URLs for each of the URLs embedded in the selected text.

Let me demonstrate how this would be used:

For those of you who are interested, this is what the command looks like. You might notice that the following code looks like the TinyURL ubiquity command which is because it does. In fact, most of the commands for searching or calling some other web service look almost exactly like this.

CmdUtils.CreateCommand({
	name: "tcp3",
	takes: {"url to shorten": noun_arb_text},
	description: "Uses the TCP3 url ...",
	homepage:"http://tcp3.com",
	preview: "Replaces the selected URL with a new tiny shorter url.",
	execute: function( longUrl ) {
		var baseUrl = "http://tcp3.com/api/processtext";
		var params = {txt: longUrl.text};
		jQuery.get( baseUrl, params, function( data ) {
				CmdUtils.setSelection( data );
			})
	}
})