-
-
Save tomjadams/7644 to your computer and use it in GitHub Desktop.
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
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); | |
}) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment