I’m fascinated by http://to. It’s a url shortener with no TLD. Some browsers, and apparently some DNS setups, don’t like the urls it creates (they want a .com or .org or anything at the end), so it’s not exactly in heavy usage. Still, I wish they had an API. In lieu of that, here’s a quick Ruby script that will run on a stock OS X install as a System Service. It’s so simple that I’m not even going to package it up… It’ll be a good chance to show the steps for creating your own utilities using Snow Leopard Services:
- Open Automator and choose “Service” from the first menu.
- Tell it that the service “receives text” in “any application”.
- Drag the “Run Shell Script” action from the left side.
- Set the Shell to Ruby
- Paste in the code below (or something of your own, hopefully far more interesting)
- Save it with an intuitive name
- Use it.
Basically, anything you can do to or with text or files using a major scripting language, you can make into a Snow Leopard service. Now that I’ve set the bar this low, I’d love to see what new Services everyone else is cooking up!
Yeah, that didn’t work out so well. It works sometimes, but leaves url parameters in the shortened url half the time. I haven’t figured out why, but I’ll leave it up and see if someone can point out the error of my ways…
Update 2: Here, this one’s shorter and more useful :)