Created
March 15, 2010 14:17
-
-
Save justin/332866 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
set the ClipURL to (the clipboard as string) | |
ignoring case | |
if ((characters 1 through 4 of ClipURL as string) is not "http") then | |
return "Malformed URL." | |
else | |
set curlCMD to ¬ | |
"curl --stderr /dev/null \"http://tinyurl.com/api-create.php?url=" & ClipURL & "\"" | |
-- Run the script and get the result: | |
set tinyURL to (do shell script curlCMD) | |
return tinyURL | |
end if | |
end ignoring |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment