The getsource part of this script is from Chessnut's $getsource script. Credits for that part goes to him!
This script shortens your links using rly.cc, it will copy the link to your clipboard.
Usage: /short [link]
If there is no link specified, a window will pop up asking which link you want to short.
alias short {
var %l, %u $iif(http://* !iswm $1,http://) $+ $iif($1,$1,$?="What link do you want to short?"), $&
%comName getSource. $+ $ticks
.comopen %comName msxml2.xmlhttp
noop $com(%comName,Open,1,bstr,GET,bstr,$+(http://rly.cc/s/mini-api.php?u=,%u),bool,false)
noop $com(%comName,Send,1)
noop $com(%comName,ResponseText,2)
%l = $com(%comName).result
.comclose %comName
echo -at Short URL: $qt($+($chr(3),10,%u,$chr(3))) ( $+ $len(%u) $+ ) -> $+($chr(3),10,%l,$chr(3)) ( $+ $len(%l) $+ )
clipboard %l
}