For some reason I’ve wanted to create my own URL shortener just for my stuff for some time now. It’s finally here: the URL shortener. Now, I’m the only one that can use the service; it’s only for my links, but when you see a URL you at least know it will link to something I’ve done.

It was super simple to setup.

First of all, I had to buy the domain name ( think J B dot ME ). Unfortunatly is not a valid domain, I’m sure someone much more important than I will grab it. Anyway, was the next best thing.

One I had the domain I installed the YOURLS (You Own URL Shortener) script at that location. It’s a series of scripts that talks to a MySQL database with some pretty cool bookmarklets and an API. The API was key for the next step: the Twitter Tools extension. As many people know, I use twitter tools to post new blog entries to my twitter profile. Since I want to get as much of my URL-shortening as possible done through the shortener now I needed to get twitter tools to use the new system. Twitter Tools has it’s own api that will let you create a shortener for any service that you could think of with some hooks that it install for WordPress. Then I threw a plugin together using the YOURLS API and now when I publish a post, Twitter Tools uses the shortener to shorten the URLs. Pretty Cool.

The plugin isn’t public, only because I thought that there wouldn’t really be anyone else who would need something like this. YOURLS does have it’s own plugin, but I don’t think it integrates with Twitter Tools and that was a deal breaker for me. If there’s anyone else that would like this plugin just let me know and I’ll polish it up and put it in the plugin directory.

As a final step I decided to forward to with a simple PHP script:


I’m sure there’s a better way to do this, but I’ve run some test and it seems to be performing decently.

The only drawback that I have seen on this whole process is the speed of my shared hosting account. I’m pretty sure it’s the actual bandwidth and not a MySQL issue. As always, I’ll keep trying to increase the performance of this.