One little enhancement I’ve made recently to my social media training and crisis communications platform, the Social Simulator, is a domain-specific URL shortener. The idea is, since we’re simulating Twitter and now Facebook in a private environment, we really ought to offer simulation participants the ability to post short, trackable URLs like they would on Twitter or Facebook in the wild. The platform’s secure and links are password-protected, but using public services like Bit.ly or Goo.gl feels wrong in this case.

I played around with Shorty, a nice-looking URL shortening tool, but one which had more complexity (logins, multiple tabs etc) than I needed or wanted. I wanted a specific kind of URL shortener, so thought I’d knock one up. A rare opportunity to build something from scratch.

Meet shURLy (see comment below re: name clash) My Name Is URL. He’s a simple chap, whose role in life is really just threefold:

  1. Take a long link, and shorten it nicely, using a short domain. 14.8m short URLs available.
  2. Restrict the URLs which can be shortened to a specific domain only e.g. mydomain.com or .uk sites
  3. Keep track of the number of clicks on that short link, and show the results when a ‘+’ is appended to the short link, à la Bit.ly

No logins, no APIs (for now), no QR codes, no social bookmarking.

govuk.info shURLy demo

I’ve got it running over on the Social Simulator platform, but I’ve made the code a bit more portable, and set up a little example at govuk.info – a special .gov.uk-only link shortener. Put in a URL to a .gov.uk page, and get a shortish URL out, like http://govuk.info/qwGK or http://govuk.info/B1kE.

Download & Technical Requirements

MyNameIsURL 0.1 is free and available under the open source GPL licence now (Zip archive, 33kb). Hosting your own shortener requires PHP, MySQL and a short domain you want to use. If you can set up things like WordPress, you should be up and running in a couple of minutes.

If you have any queries, suggestions or feedback, please leave a comment below, or drop me an email at the address above. Thanks!

Get notified of new blog posts by email

Comments

Yes, that’s a nice one, and I did look at it. I think the domain-specific constraint was the key point for me – I need users to be able to create links within a specific environment. I could try and hack an existing tool… or build my own.

To be honest, I’ve not written mysql_query() PHP statements for so long thanks to WordPress, it was quite nice to get back to basics…

Just wanted to drop you a line and let you know about a name collision with your project name. About a year ago, I created a Drupal module project called ShURLy. It provides very similar functionality to your project and I’m even though both are free GPLed projects, I’m a little concerned about people confusing the two.

For more information about the project, you can read http://www.lullabot.com/articles/drupal-url-shortener, see it on GitHub at https://github.com/lullabot/shurly, and see it in action at http://lb.cm.

I don’t know if you’d be willing to change the name of your project, but it would certainly help with any confusion. I feel obligated to make some name suggestions. How about “James URL Jones”? “The Duke of URL”? “The URL of Sandwich”? “My Name is URL”? “URLybird”? “SqURL”? 🙂

Thanks for your consideration.

I’d be happy to – I did a quick Google before coming up with the name and didn’t find your project. Sorry about that.

Great name suggestions too :)I quite like The URL of Sandwich and My Name Is URL, but heaven help me if I end up needing to write it out lots.

Good luck with your project