added support for python 2.7 (using urllib2 instead of urllib)

Tested under python 2.7 and 3.2