Skip to content

Instantly share code, notes, and snippets.

@harlley harlley/x
Created Feb 6, 2009

Embed
What would you like to do?
Replaces the selected URL with a Migre.me URL
//teste
CmdUtils.CreateCommand({
name: "migre",
homepage: "http://webtoo.com.br",
author: { name: "Harlley", email: "harlley@gmail.com"},
license: "GPL",
description: "Replaces the selected URL with a Migre.me URL",
takes: {"url to shorten": noun_arb_text},
preview: "Replaces the selected URL with a Migre.me URL",
execute: function( urlToShorten ) {
var baseUrl = "http://migre.me/api.xml";
var params = {url: urlToShorten.text};
jQuery.get( baseUrl, params, function( tinyUrl ) {
jQuery("item", tinyUrl ).each(function(){
migre = jQuery("migre", this).text();
CmdUtils.setSelection( migre );
});
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.