[fix] unused globals removed

This commit is contained in:
Adam Tauber 2014-07-09 01:18:37 +02:00
parent 84c3251bdc
commit 66f02dc2b6
7 changed files with 0 additions and 8 deletions

View file

@ -27,7 +27,6 @@ def request(query, params):
def response(resp): def response(resp):
global base_url
results = [] results = []
dom = html.fromstring(resp.content) dom = html.fromstring(resp.content)
for result in dom.xpath('//div[@class="sa_cc"]'): for result in dom.xpath('//div[@class="sa_cc"]'):

View file

@ -29,7 +29,6 @@ def request(query, params):
def response(resp): def response(resp):
global base_url
results = [] results = []
dom = html.fromstring(resp.content) dom = html.fromstring(resp.content)
for result in dom.xpath('//div[@class="sa_cc"]'): for result in dom.xpath('//div[@class="sa_cc"]'):

View file

@ -31,7 +31,6 @@ def request(query, params):
def response(resp): def response(resp):
global base_url
results = [] results = []
try: try:
_, conversion_rate, _ = resp.text.split(',', 2) _, conversion_rate, _ = resp.text.split(',', 2)

View file

@ -18,7 +18,6 @@ def request(query, params):
def response(resp): def response(resp):
global base_url
results = [] results = []
if resp.status_code == 302: if resp.status_code == 302:
return results return results

View file

@ -10,7 +10,6 @@ accept_header = 'application/vnd.github.preview.text-match+json'
def request(query, params): def request(query, params):
global search_url
params['url'] = search_url.format(query=urlencode({'q': query})) params['url'] = search_url.format(query=urlencode({'q': query}))
params['headers']['Accept'] = accept_header params['headers']['Accept'] = accept_header
return params return params

View file

@ -18,7 +18,6 @@ def request(query, params):
def response(resp): def response(resp):
global base_url
results = [] results = []
search_res = loads(resp.text) search_res = loads(resp.text)
for result in search_res.get('collection', []): for result in search_res.get('collection', []):

View file

@ -12,13 +12,11 @@ content_xpath = './/p[@class="js-tweet-text tweet-text"]//text()'
def request(query, params): def request(query, params):
global search_url
params['url'] = search_url + urlencode({'q': query}) params['url'] = search_url + urlencode({'q': query})
return params return params
def response(resp): def response(resp):
global base_url
results = [] results = []
dom = html.fromstring(resp.text) dom = html.fromstring(resp.text)
for tweet in dom.xpath('//li[@data-item-type="tweet"]'): for tweet in dom.xpath('//li[@data-item-type="tweet"]'):