Wishful Coding

Didn't you ever wish your computer understood you?

Shorten Wordpress urls in Adium

I use Adium as my Twitter client, it includes a nice url shortener supporting multiple services, so what is my problem? Nothing, I just had some fun making use of the wp.me service. Every Wordpress blog contains a header containing the short url, so it was only 3 lines of Applescript and one line of Bash to get the short url of any wp blog and post it to Adium. If anyone with knowlegde of regex/grep comes around, he might get it to work with any shorturl/shortlink header.

Shorten Wordpress urls in Adium

The current line looks like this:
curl --head <url> -s | grep -o http://wp\.me/[a-zA-Z0-9\-]*
Update: sed seems to be able to do what I want.
curl --head http://pepijn.cqhosting.nl/ -s | \
sed -n 's/Link: <\(.*\)>; rel=shortlink/\1/p'
Use:
%_shorten{<url>}
Download the script: shorten.AdiumScripts
Pepijn de Vos