mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Proxy for Google.
This commit is contained in:
parent
0533feafe9
commit
b6a03d9ac1
@ -95,8 +95,6 @@ totalSearches = 0
|
|||||||
totalTime = 0
|
totalTime = 0
|
||||||
last24hours = structures.queue()
|
last24hours = structures.queue()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def search(log, queries, **kwargs):
|
def search(log, queries, **kwargs):
|
||||||
assert not isinstance(queries, basestring), 'Old code: queries is a list.'
|
assert not isinstance(queries, basestring), 'Old code: queries is a list.'
|
||||||
try:
|
try:
|
||||||
@ -104,6 +102,9 @@ def search(log, queries, **kwargs):
|
|||||||
for (i, query) in enumerate(queries):
|
for (i, query) in enumerate(queries):
|
||||||
if len(query.split(None, 1)) > 1:
|
if len(query.split(None, 1)) > 1:
|
||||||
queries[i] = repr(query)
|
queries[i] = repr(query)
|
||||||
|
proxy = conf.supybot.protocols.http.proxy()
|
||||||
|
if proxy:
|
||||||
|
kwargs['http_proxy'] = proxy
|
||||||
data = google.doGoogleSearch(' '.join(queries), **kwargs)
|
data = google.doGoogleSearch(' '.join(queries), **kwargs)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
totalSearches += 1
|
totalSearches += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user