I recently wrote a post about why I made my own url shortener. I’m now porting some of my common uses over to use this new shortener (keep life simple, right?). The first thing I wanted to address was adding an option to the right-click menu to shorten whatever page I was currently viewing and copy it to the clipboard. The easiest way I found to do this was to modify an existing Firefox addon called Shorten URL. It works particularly well because it already supports a TON of shortening services and adding new ones is a breeze. So how do you do it?
pref("extensions.shortenURL.name.145", "w3t.org"); and add a new line below it (incrementing the number) and swap out the name w/ whatever you want to reference your url shortener as. (in my case pref("extensions.shortenURL.name.146", "jfox.in");pref("extensions.shortenURL.145", "http://w3t.org/?module=ShortURL&file=Add&mode=API&url=");. Add a new line below this one incrementing the number again (to match the one in the last step) and adding the url of the page to submit a url to shorten (the url will be appended to the end). For example: pref("extensions.shortenURL.146", "http://jfox.in/make-tiny.php?url="); (note the example here won’t actually work because my shortener is private).A quick trailing note: This all assumes that your shortener has an interface that allows a url to be passed as a GET parameter and returns the shortened url in plain text as a result of that request. This is straight forward to implement, but worth mentioning. You should now be able to shorten simply by right-clicking and selecting the “Shorten this page URL” option (which will also copy the short url to your clipboard and put it in the location bar). Enjoy!
A little while ago I setup my own short URL service on http://jfox.in. I already know there are tons of free services that already do this and there are even a few open source alternatives of projects aimed at this kind of thing…so why then did I decide to write my own? There are actually a couple reasons:
Anyone that is code savvy and is considering doing this – whatever your reasons – I definitely recommend doing it. It was simple and something I enjoyed, and it gives me the control I want in such a simple application. Not every problem makes sense to roll your own solution for, but this is one that does in my mind since it’s so simple.
I honestly wouldn’t be surprised if we see more web services offering their own custom URLs. It allows a bit more brand recognition and all the control issues I mention above. It also seems that short URL services aren’t going away anytime soon.
Do you have any thoughts on the merits of short URL services? Have you written your own or considered doing so?