Dynamic URL shortening

L

Littlefield, Tyler

Hello all:
I started working on a project with someone else quite recently, and he
has a request. The project requires an URL shortener, and he would like
it to be dynamic for both users and developers. Apparently some
applications on the mac allow for the user to input some data on a URL
shortener and use that specific service to shorten URLS. So I'm curious
if anyone has had any experience with this in python/can recommend a
library to look at.

Secondly, my requirement to make this dynamic for developers. The way I
did this was to use a metaclass that the base URLShortener will inherit,
which will add itself to a shortener registry. This works well enough,
and all I really need to do is something like:
shortener = factory.getShortener("bitly")
url = shortener.shorten("http://google.com")
How viable is this solution? It seems like it's nice enough, are there
other approaches to handling something like this?

--

Take care,
Ty
my website:
http://tds-solutions.net
my blog:
http://tds-solutions.net/blog
skype: st8amnd127
My programs don't have bugs; they're randomly added features!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top