import compatible with python2.x and python 3.x

replace import StringIO, httplib and urllib
Merge pull request #176 from ivantchomgue/patch-12

import compatible with python2.x and python 3.x