Browse Source

[ehn] added ixquick engine, using startpage engine

pw3t 11 years ago
parent
commit
1dd35e9916
2 changed files with 15 additions and 3 deletions
  1. 8 3
      searx/engines/startpage.py
  2. 7 0
      settings.yml

+ 8 - 3
searx/engines/startpage.py

@@ -3,8 +3,8 @@ from lxml import html
 from urlparse import urlparse
 from cgi import escape
 
-base_url = 'https://startpage.com/'
-search_url = base_url+'do/search'
+base_url = None
+search_url = None
 
 def request(query, params):
     global search_url
@@ -26,6 +26,11 @@ def response(resp):
         url = link.attrib.get('href')
         parsed_url = urlparse(url)
         title = link.text_content()
-        content = result.xpath('./p[@class="desc"]')[0].text_content()
+
+        content =''
+        if len(result.xpath('./p[@class="desc"]')):
+            content = result.xpath('./p[@class="desc"]')[0].text_content()
+        
         results.append({'url': url, 'title': title, 'content': content})
+    
     return results

+ 7 - 0
settings.yml

@@ -68,6 +68,13 @@ engines:
 
   - name : startpage
     engine : startpage
+    base_url : 'https://startpage.com/'
+    search_url : 'https://startpage.com/do/search'
+
+  - name : ixquick
+    engine : startpage
+    base_url : 'https://www.ixquick.com/'
+    search_url : 'https://www.ixquick.com/do/search'
 
   - name : twitter
     engine : twitter