is.gd at command line…

Saved this on my PATH as shrink_url…

#!/bin/sh
curl "http://is.gd/api.php?longurl=$(echo $@ | sed 's/\ /+/g')"

Which lets me do this:

$ shrink_url http://current.com/items/90029658_death-star-destroys-enterprise.htm
http://is.gd/xHYe

Pipe to clipboard and you’re ready to paste into a browser. I suppose I could also enclose the result in a $() call to my favorite command line Twitter client, but I’m not feeling that fancy yet.

$ shrink_url http://current.com/items/90029658_death-star-destroys-enterprise.htm | cb
$ cb
http://is.gd/xHYe