From 9bc24080bf4c24a182cf2b5616095c2f6bea5821 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 13 Mar 2020 00:43:05 +0100 Subject: [PATCH] [fix] add answers, suggestions, corrections to rss output fixes #1888 --- .../__common__/opensearch_response_rss.xml | 24 +++++++++++++++++++ searx/webapp.py | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/searx/templates/__common__/opensearch_response_rss.xml b/searx/templates/__common__/opensearch_response_rss.xml index 32c42e7c7..3781dd87c 100644 --- a/searx/templates/__common__/opensearch_response_rss.xml +++ b/searx/templates/__common__/opensearch_response_rss.xml @@ -25,5 +25,29 @@ {% 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 b661e39d1..da2bf34a9 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -637,9 +637,13 @@ def index(): response.headers.add('Content-Disposition', cont_disp) return response elif output_format == 'rss': + print(results) 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=number_of_results, base_url=get_base_url(),