From 75b5813031bb73f88c0d8206cd81ceba51cd30e7 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 19 Oct 2024 16:54:51 +0200 Subject: [PATCH 1/3] [chore] rss: rename from searx to SearXNG --- searx/templates/simple/opensearch_response_rss.xml | 4 ++-- tests/unit/test_webapp.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/templates/simple/opensearch_response_rss.xml b/searx/templates/simple/opensearch_response_rss.xml index 82d3f7c4e..5093643c9 100644 --- a/searx/templates/simple/opensearch_response_rss.xml +++ b/searx/templates/simple/opensearch_response_rss.xml @@ -3,9 +3,9 @@ xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> - Searx search: {{ q|e }} + SearXNG search: {{ q|e }} {{ url_for('search', _external=True) }}?q={{ q|e }} - Search results for "{{ q|e }}" - searx + Search results for "{{ q|e }}" - SearXNG {{ number_of_results }} 1 {{ number_of_results }} diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index 31bfdec3d..65705d164 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -180,7 +180,7 @@ class ViewsTestCase(SearxTestCase): # pylint: disable=missing-class-docstring, def test_search_rss(self): result = self.app.post('/search', data={'q': 'test', 'format': 'rss'}) - self.assertIn(b'Search results for "test" - searx', result.data) + self.assertIn(b'Search results for "test" - SearXNG', result.data) self.assertIn(b'3', result.data) From 6303c56c55e7ad147879a320b8ac4c890dd8db41 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 19 Oct 2024 16:55:09 +0200 Subject: [PATCH 2/3] [feat] rss: add xsl style to view rss in browser --- searx/static/themes/simple/xsl/rss.xsl | 59 +++++++++++++++++++ .../simple/opensearch_response_rss.xml | 1 + 2 files changed, 60 insertions(+) create mode 100644 searx/static/themes/simple/xsl/rss.xsl diff --git a/searx/static/themes/simple/xsl/rss.xsl b/searx/static/themes/simple/xsl/rss.xsl new file mode 100644 index 000000000..a8d9225f5 --- /dev/null +++ b/searx/static/themes/simple/xsl/rss.xsl @@ -0,0 +1,59 @@ + + + + + + + + + <xsl:value-of select="channel/title" /> RSS Feed + + + + + + +
+

+ +

+
+
+
+ + + +
+ + +
+ +
diff --git a/searx/templates/simple/opensearch_response_rss.xml b/searx/templates/simple/opensearch_response_rss.xml index 5093643c9..b827bae85 100644 --- a/searx/templates/simple/opensearch_response_rss.xml +++ b/searx/templates/simple/opensearch_response_rss.xml @@ -1,4 +1,5 @@ + From 9e7823df67f2f5bef9400b9adf0408467d469729 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 29 Oct 2024 15:09:40 +0100 Subject: [PATCH 3/3] [WIP] element isn't a part of the RSS 2.0 spec [1] [1] https://cyber.harvard.edu/rss/rss.html Signed-off-by: Markus Heiser --- searx/static/themes/simple/xsl/rss.xsl | 86 +++++++------------ .../simple/opensearch_response_rss.xml | 25 +----- searx/webapp.py | 3 - 3 files changed, 34 insertions(+), 80 deletions(-) diff --git a/searx/static/themes/simple/xsl/rss.xsl b/searx/static/themes/simple/xsl/rss.xsl index a8d9225f5..7de7f8037 100644 --- a/searx/static/themes/simple/xsl/rss.xsl +++ b/searx/static/themes/simple/xsl/rss.xsl @@ -1,59 +1,39 @@ - - - - - <xsl:value-of select="channel/title" /> RSS Feed - - - - - - -
-

- -

-
-
-
- - - -
- - + + + <xsl:value-of select="channel/title" />RSS Feed + + + + + +
+

+ +

+
+
+
+ + + +
+ +
-
diff --git a/searx/templates/simple/opensearch_response_rss.xml b/searx/templates/simple/opensearch_response_rss.xml index b827bae85..574f32e69 100644 --- a/searx/templates/simple/opensearch_response_rss.xml +++ b/searx/templates/simple/opensearch_response_rss.xml @@ -21,34 +21,11 @@ {% for r in results %} {{ r.title }} + result {{ r.url }} {{ r.content }} {% if r.pubdate %}{{ r.pubdate }}{% endif %} {% endfor %} - {% if answers %} - {% for a in answers %} - - {{ a }} - answer - - {% endfor %} - {% endif %} - {% if corrections %} - {% for a in corrections %} - - {{ a }} - correction - - {% endfor %} - {% endif %} - {% if suggestions %} - {% for a in suggestions %} - - {{ a }} - suggestion - - {% endfor %} - {% endif %}
diff --git a/searx/webapp.py b/searx/webapp.py index 19c477794..21f678ce5 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -740,9 +740,6 @@ def search(): response_rss = render( 'opensearch_response_rss.xml', results=results, - answers=result_container.answers, - corrections=result_container.corrections, - suggestions=result_container.suggestions, q=request.form['q'], number_of_results=result_container.number_of_results, )