on master help sign in
[ehn] added ixquick engine, using startpage engine
commita01042ae616524160f32bfbca0e833b1de6dab58 authorpw3t <romain@berthor.fr> dateSun 19 Jan 2014, 21:20 (13 years ago) parent132681b
2 files changed+15−3
searx/engines/startpage.py+8−3 searx/settings_robot.yml+7
searx/engines/startpage.py+8−3
@@ -1,8 +1,8 @@
11from urllib import urlencode
22from lxml import html
33
4−base_url = 'https://startpage.com/'
5−search_url = base_url+'do/search'
4+base_url = None
5+search_url = None
66
77
88def request(query, params):
@@ -24,6 +24,11 @@ def response(resp):
2424 link = result.xpath('.//h3/a')[0]
2525 url = link.attrib.get('href')
2626 title = link.text_content()
27− content = result.xpath('./p[@class="desc"]')[0].text_content()
27+
28+ content =''
29+ if len(result.xpath('./p[@class="desc"]')):
30+ content = result.xpath('./p[@class="desc"]')[0].text_content()
31+
2832 results.append({'url': url, 'title': title, 'content': content})
33+
2934 return results
searx/settings_robot.yml+7
@@ -68,6 +68,13 @@ engines:
6868
6969 - name : startpage
7070 engine : startpage
71+ base_url : 'https://startpage.com/'
72+ search_url : 'https://startpage.com/do/search'
73+
74+ - name : ixquick
75+ engine : startpage
76+ base_url : 'https://www.ixquick.com/'
77+ search_url : 'https://www.ixquick.com/do/search'
7178
7279 - name : twitter
7380 engine : twitter