From 6f49bd8f08fbd52c67e21477fc2d21553d8220d7 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Mon, 17 Mar 2014 11:43:00 +0100 Subject: [PATCH] adding publish date to video-results and rss-feed --- searx/templates/opensearch_response_rss.xml | 1 + searx/templates/result_templates/videos.html | 1 + searx/webapp.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/searx/templates/opensearch_response_rss.xml b/searx/templates/opensearch_response_rss.xml index 417b195a3..5673eb2e1 100644 --- a/searx/templates/opensearch_response_rss.xml +++ b/searx/templates/opensearch_response_rss.xml @@ -16,6 +16,7 @@ {{ r.title }} {{ r.url }} {{ r.content }} + {% if r.pubdate %}{{ r.pubdate }}{% endif %} {% endfor %} diff --git a/searx/templates/result_templates/videos.html b/searx/templates/result_templates/videos.html index d3391f0d3..ab869a6eb 100644 --- a/searx/templates/result_templates/videos.html +++ b/searx/templates/result_templates/videos.html @@ -5,6 +5,7 @@

{{ result.title|safe }}

+ {% if result.publishedDate %}

{{ result.publishedDate }}

{% endif %}  {{ result.title }}

{{ result.url }}

diff --git a/searx/webapp.py b/searx/webapp.py index a52dd6289..d06c58f32 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -168,6 +168,8 @@ def index(): else: result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa else: + # TODO using right timezone + result['pubdate'] = result['publishedDate'].strftime('%a, %d %b %Y %H:%M:%S +0000') result['publishedDate'] = format_date(result['publishedDate']) if search.request_data.get('format') == 'json':