-
-
Save harlley/59549 to your computer and use it in GitHub Desktop.
Replaces the selected URL with a Migre.me URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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