import compatible with python2.x and python 3.x

replace import StringIO, httplib and urllib