Proxy for Google.

This commit is contained in:
Jeremy Fincher 2004-08-03 04:29:25 +00:00
parent 0533feafe9
commit b6a03d9ac1

View File

@ -95,8 +95,6 @@ totalSearches = 0
totalTime = 0
last24hours = structures.queue()
def search(log, queries, **kwargs):
assert not isinstance(queries, basestring), 'Old code: queries is a list.'
try:
@ -104,6 +102,9 @@ def search(log, queries, **kwargs):
for (i, query) in enumerate(queries):
if len(query.split(None, 1)) > 1:
queries[i] = repr(query)
proxy = conf.supybot.protocols.http.proxy()
if proxy:
kwargs['http_proxy'] = proxy
data = google.doGoogleSearch(' '.join(queries), **kwargs)
now = time.time()
totalSearches += 1