opensearch_response_rss.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="{{ url_for('static', filename='xsl/rss.xsl') }}" type="text/xsl"?>
  3. <rss version="2.0"
  4. xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
  5. xmlns:atom="http://www.w3.org/2005/Atom">
  6. <channel>
  7. <title>SearXNG search: {{ q|e }}</title>
  8. <link>{{ url_for('search', _external=True) }}?q={{ q|e }}</link>
  9. <description>Search results for "{{ q|e }}" - SearXNG</description>
  10. <opensearch:totalResults>{{ number_of_results }}</opensearch:totalResults>
  11. <opensearch:startIndex>1</opensearch:startIndex>
  12. <opensearch:itemsPerPage>{{ number_of_results }}</opensearch:itemsPerPage>
  13. <atom:link rel="search" type="application/opensearchdescription+xml" href="{{ opensearch_url }}"/>
  14. <opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" />
  15. {% if error_message %}
  16. <item>
  17. <title>Error</title>
  18. <description>{{ error_message|e }}</description>
  19. </item>
  20. {% endif %}
  21. {% for r in results %}
  22. <item>
  23. <title>{{ r.title }}</title>
  24. <link>{{ r.url }}</link>
  25. <description>{{ r.content }}</description>
  26. {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
  27. </item>
  28. {% endfor %}
  29. {% if answers %}
  30. {% for a in answers %}
  31. <item>
  32. <title>{{ a }}</title>
  33. <type>answer</type>
  34. </item>
  35. {% endfor %}
  36. {% endif %}
  37. {% if corrections %}
  38. {% for a in corrections %}
  39. <item>
  40. <title>{{ a }}</title>
  41. <type>correction</type>
  42. </item>
  43. {% endfor %}
  44. {% endif %}
  45. {% if suggestions %}
  46. {% for a in suggestions %}
  47. <item>
  48. <title>{{ a }}</title>
  49. <type>suggestion</type>
  50. </item>
  51. {% endfor %}
  52. {% endif %}
  53. </channel>
  54. </rss>