mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-28 13:42:36 +01:00
Proxy for Google.
This commit is contained in:
parent
0533feafe9
commit
b6a03d9ac1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user