diff --git a/got3/manager/TweetManager.py b/got3/manager/TweetManager.py index 5c627749..9f8983c2 100644 --- a/got3/manager/TweetManager.py +++ b/got3/manager/TweetManager.py @@ -100,6 +100,9 @@ def getJsonReponse(tweetCriteria, refreshCursor, cookieJar, proxy): if hasattr(tweetCriteria, 'querySearch'): urlGetData += ' ' + tweetCriteria.querySearch + if hasattr(tweetCriteria, 'near'): + urlGetData += "&near:" + tweetCriteria.near + "within:" + tweetCriteria.within + if hasattr(tweetCriteria, 'lang'): urlLang = 'lang=' + tweetCriteria.lang + '&' else: @@ -118,9 +121,9 @@ def getJsonReponse(tweetCriteria, refreshCursor, cookieJar, proxy): ] if proxy: - opener = urllib2.build_opener(urllib2.ProxyHandler({'http': proxy, 'https': proxy}), urllib2.HTTPCookieProcessor(cookieJar)) + opener = urllib.request.build_opener(urllib.request.ProxyHandler({'http': proxy, 'https': proxy}), urllib.request.HTTPCookieProcessor(cookieJar)) else: - opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar)) + opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookieJar)) opener.addheaders = headers try: @@ -135,4 +138,4 @@ def getJsonReponse(tweetCriteria, refreshCursor, cookieJar, proxy): dataJson = json.loads(jsonResponse.decode()) - return dataJson \ No newline at end of file + return dataJson