[sakai2-tcc] URL Shortening service for Sakai

Steve Swinsburg steve.swinsburg at gmail.com
Wed Aug 25 05:43:00 PDT 2010


Hi all,

Cast your minds back to 2009 and you may remember the discussions around TinyUrlService, a URL shortening service I created for Sakai. If you don't remember, read this short blog post: http://steve-on-sakai.blogspot.com/2009/12/tinyurlservice-10-released.html

It turned out that Sakai wasn't ready for such a beast at the time so it was shelved. An interesting idea arose out of that discussion though, in that it could be a pluggable interface that institutions could configure themselves. So, with a few hours up my sleeve, this is exactly what I've done.

I call it ShortenedUrlService (so as to avoid possible trademark infringements). In essence, it is a three method API (two forms of shortenUrl and one to resolve it again, if needed) which you can provide multiple implementations of. 

I have turned the original TinyUrlService into RandomisedUrlService which still has the same logic in it, creating random strings for the URLs. There is the default NoOpUrlService and also a BitlyUrlService which calls out to the bit.ly API to shorten the given URL. 

I also plan to implement several other URL shortening implementations like tr.im, is.gd and tinyurl.com itself. The potential is there for any form of URL shortener.

Configuration is by way of a sakai.property to tell it what implementation bean to use:
shortenedurl.implementation=org.sakaiproject.shortenedurl.api.RandomisedUrlService

For some implementations you need other properties (e.g API keys). This is documented.

The code is here: https://source.sakaiproject.org/contrib/shortenedurl/

I'd like to get this into 2.8. It still needs a little work but mainly in adding in more implementations. 

By default, it is a no-op, ie it does nothing and simply returns the original URL, and no tool or service uses it. It is up to the institution then to configure it in sakai.properties, and of course for tools to adopt.

What do you think? 

cheers,
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai2-tcc/attachments/20100825/ac560710/attachment.html 


More information about the sakai2-tcc mailing list