Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7669

Dynamic URL shortening

Date 2011-06-14 22:03 -0600
From "Littlefield, Tyler" <tyler@tysdomain.com>
Subject Dynamic URL shortening
Newsgroups comp.lang.python
Message-ID <mailman.254.1308111005.11593.python-list@python.org> (permalink)

Show all headers | View raw


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!

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Dynamic URL shortening "Littlefield, Tyler" <tyler@tysdomain.com> - 2011-06-14 22:03 -0600

csiph-web