on master help sign in
Merge pull request #29 from pw3t/ixquick

Ixquick

commitf1db60d28f3512186b73ede98f814688513a1e54 authorAdam Tauber <asciimoo@gmail.com> dateThu 23 Jan 2014, 23:48 (13 years ago) parent59eeeaab82ba74
3 files changed+22−4
searx/engines/startpage.py+8−4 searx/settings.yml+7 searx/settings_robot.yml+7
searx/engines/startpage.py+8−4
@@ -1,9 +1,8 @@
11from urllib import urlencode
22from lxml import html
33
4−base_url = 'https://startpage.com/'
5−search_url = base_url+'do/search'
6−
4+base_url = None
5+search_url = None
76
87def request(query, params):
98 global search_url
@@ -24,6 +23,11 @@ def response(resp):
2423 link = result.xpath('.//h3/a')[0]
2524 url = link.attrib.get('href')
2625 title = link.text_content()
27− content = result.xpath('./p[@class="desc"]')[0].text_content()
26+
27+ content =''
28+ if len(result.xpath('./p[@class="desc"]')):
29+ content = result.xpath('./p[@class="desc"]')[0].text_content()
30+
2831 results.append({'url': url, 'title': title, 'content': content})
32+
2933 return results
searx/settings.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
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