Inspired by this helpful post about Alfred, I thought I'd share a quick and easy way to shorten a URL with X.CO using Alfred.
First thing you'll need is your API key, which can be found on the Settings page.
Once you have that, you just need to fill in the Terminal Shortcut like so:
That "Command" field reads (replace KEY with the API key you copied previously): curl -s http://api.x.co/Squeeze.svc/text/KEY?url={query} | pbcopy
Hit "Save," make it "Silent" by checking that box, and you're ready to shorten. To use it, invoke Alfred, type "x http://your-url-to-shorten.com/", and press Return. Your clipboard will contain the shortened URL.
Another option that works really well is to create a Terminal Shortcut mapped to "xc" that runs the Command "curl -s http://api.x.co/Squeeze.svc/text/KEY?url=$(pbpaste) | pbcopy
". This version will pull the source URL from your clipboard, shorten it, and replace it on the clipboard with the shortened form. That is very handy.
[The views expressed on this website/weblog are mine alone and do not necessarily reflect the views of Go Daddy Software, Inc.]