on master help sign in
[fix] add answers, suggestions, corrections to rss output

fixes #1888

commit9bc24080bf4c24a182cf2b5616095c2f6bea5821 authorAdam Tauber <asciimoo@gmail.com> dateFri 13 Mar 2020, 00:43 (7 years ago) parent3aa49cb
2 files changed+28
searx/templates/__common__/opensearch_response_rss.xml+24 searx/webapp.py+4
searx/templates/__common__/opensearch_response_rss.xml+24
@@ -25,5 +25,29 @@
2525 {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
2626 </item>
2727 {% endfor %}
28+ {% if answers %}
29+ {% for a in answers %}
30+ <item>
31+ <title>{{ a }}</title>
32+ <type>answer</type>
33+ </item>
34+ {% endfor %}
35+ {% endif %}
36+ {% if corrections %}
37+ {% for a in corrections %}
38+ <item>
39+ <title>{{ a }}</title>
40+ <type>correction</type>
41+ </item>
42+ {% endfor %}
43+ {% endif %}
44+ {% if suggestions %}
45+ {% for a in suggestions %}
46+ <item>
47+ <title>{{ a }}</title>
48+ <type>suggestion</type>
49+ </item>
50+ {% endfor %}
51+ {% endif %}
2852 </channel>
2953</rss>
searx/webapp.py+4
@@ -637,9 +637,13 @@ def index():
637637 response.headers.add('Content-Disposition', cont_disp)
638638 return response
639639 elif output_format == 'rss':
640+ print(results)
640641 response_rss = render(
641642 'opensearch_response_rss.xml',
642643 results=results,
644+ answers=result_container.answers,
645+ corrections=result_container.corrections,
646+ suggestions=result_container.suggestions,
643647 q=request.form['q'],
644648 number_of_results=number_of_results,
645649 base_url=get_base_url(),