From c7906555a0e64939c8905df5c48cda8158e3ae4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Sun, 6 Nov 2016 01:17:30 +0100 Subject: [PATCH 1/2] add lobste.rs xpath engine --- searx/settings.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/searx/settings.yml b/searx/settings.yml index 13903459..573cf545 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -313,6 +313,16 @@ engines: timeout : 4.0 disabled : True + - name : lobste.rs + engine : xpath + search_url : https://lobste.rs/search?utf8=%E2%9C%93&q={query}&what=stories&order=relevance + results_xpath : //li[contains(@class, "story")] + url_xpath : .//span[@class="link"]/a/@href + title_xpath : .//span[@class="link"]/a + content_xpath : .//a[@class="domain"] + categories : it + shortcut : lo + - name : microsoft academic engine : json_engine paging : True From 7d26b3f8f8659491d3da94aeb71bd0d9b5f7a257 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 6 Nov 2016 02:51:14 +0100 Subject: [PATCH 2/2] [fix] suspend end time check --- searx/search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/searx/search.py b/searx/search.py index 4c4a6a2f..c3f1566a 100644 --- a/searx/search.py +++ b/searx/search.py @@ -274,7 +274,8 @@ class Search(object): engine = engines[selected_engine['name']] # skip suspended engines - if engine.suspend_end_time and engine.suspend_end_time <= time(): + if engine.suspend_end_time >= time(): + logger.debug('Engine currently suspended: %s', selected_engine['name']) continue # if paging is not supported, skip