opensearch_response_rss.xml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="{{ url_for('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. <type>result</type>
  25. <link>{{ r.url }}</link>
  26. <description>{{ r.content }}</description>
  27. {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
  28. </item>
  29. {% endfor %}
  30. </channel>
  31. </rss>