on master help sign in
adding publish date to video-results and rss-feed
commit6f49bd8f08fbd52c67e21477fc2d21553d8220d7 authorThomas Pointhuber <thomas.pointhuber@gmx.at> dateMon 17 Mar 2014, 11:43 (13 years ago) parentdead837
3 files changed+4
searx/templates/opensearch_response_rss.xml+1 searx/templates/result_templates/videos.html+1 searx/webapp.py+2
searx/templates/opensearch_response_rss.xml+1
@@ -16,6 +16,7 @@
1616 <title>{{ r.title }}</title>
1717 <link>{{ r.url }}</link>
1818 <description>{{ r.content }}</description>
19+ {% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
1920 </item>
2021 {% endfor %}
2122 </channel>
searx/templates/result_templates/videos.html+1
@@ -5,6 +5,7 @@
55
66 <p>
77 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
8+ {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
89 <a href="{{ result.url }}"><img width="400px" src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a>
910 <p class="url">{{ result.url }}</p>
1011 </p>
searx/webapp.py+2
@@ -168,6 +168,8 @@ def index():
168168 else:
169169 result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa
170170 else:
171+ # TODO using right timezone
172+ result['pubdate'] = result['publishedDate'].strftime('%a, %d %b %Y %H:%M:%S +0000')
171173 result['publishedDate'] = format_date(result['publishedDate'])
172174
173175 if search.request_data.get('format') == 'json':