From 74ca542a0282e269c991cc75511ccc76a7c8901c Mon Sep 17 00:00:00 2001 From: rhapsodhy Date: Sat, 11 Jan 2014 03:31:54 +0000 Subject: [enh] set up special css classes for highlighting results + highlight definitions with dark grey border --- searx/engines/duckduckgo_definitions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'searx/engines') diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py index 2d97f8154..7b3950b85 100644 --- a/searx/engines/duckduckgo_definitions.py +++ b/searx/engines/duckduckgo_definitions.py @@ -13,9 +13,10 @@ def response(resp): results = [] if 'Definition' in search_res: if search_res.get('AbstractURL'): - res = {'title' : search_res.get('Heading', '') - ,'content' : search_res.get('Definition', '') - ,'url' : search_res.get('AbstractURL', '') + res = {'title' : search_res.get('Heading', '') + ,'content' : search_res.get('Definition', '') + ,'url' : search_res.get('AbstractURL', '') + ,'class' : 'definition_result' } results.append(res) -- cgit v1.2.3 From b0a440421772c334b090f89187b747a350d31e5a Mon Sep 17 00:00:00 2001 From: rhapsodhy Date: Sat, 11 Jan 2014 03:33:41 +0000 Subject: [enh] highlight piratebay results with light grey border, and indent peers+magnet link --- searx/engines/piratebay.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'searx/engines') diff --git a/searx/engines/piratebay.py b/searx/engines/piratebay.py index 95ab884d5..11538dd6b 100644 --- a/searx/engines/piratebay.py +++ b/searx/engines/piratebay.py @@ -28,8 +28,8 @@ def response(resp): title = ' '.join(link.xpath('.//text()')) content = escape(' '.join(result.xpath('.//font[@class="detDesc"]//text()'))) seed, leech = result.xpath('.//td[@align="right"]/text()')[:2] - content += '
Seed: %s, Leech: %s' % (seed, leech) magnetlink = result.xpath('.//a[@title="Download this torrent using magnet"]')[0] - content += '
magnet link' % urljoin(url, magnetlink.attrib['href']) - results.append({'url': href, 'title': title, 'content': content}) + results.append({'url': href, 'title': title, 'content': content, + 'seed': seed, 'leech': leech, 'magnetlink': magnetlink.attrib['href'], + 'template': 'torrent.html'}) return results -- cgit v1.2.3