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.
The current line looks like this:
Update: sed seems to be able to do what I want.
Use:
Download the script: shorten.AdiumScripts

curl --head <url> -s | grep -o http://wp\.me/[a-zA-Z0-9\-]*
curl --head http://pepijn.cqhosting.nl/ -s | \ sed -n 's/Link: <\(.*\)>; rel=shortlink/\1/p'
%_shorten{<url>}
Posted on Saturday, Feb 20, 2010

0 Comments
Leave a Comment