forked from zaclys/searxng
adding publish date to video-results and rss-feed
This commit is contained in:
parent
dead837f57
commit
6f49bd8f08
|
@ -16,6 +16,7 @@
|
||||||
<title>{{ r.title }}</title>
|
<title>{{ r.title }}</title>
|
||||||
<link>{{ r.url }}</link>
|
<link>{{ r.url }}</link>
|
||||||
<description>{{ r.content }}</description>
|
<description>{{ r.content }}</description>
|
||||||
|
{% if r.pubdate %}<pubDate>{{ r.pubdate }}</pubDate>{% endif %}
|
||||||
</item>
|
</item>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</channel>
|
</channel>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
|
<h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
|
||||||
|
{% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
|
||||||
<a href="{{ result.url }}"><img width="400px" src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a>
|
<a href="{{ result.url }}"><img width="400px" src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a>
|
||||||
<p class="url">{{ result.url }}</p>
|
<p class="url">{{ result.url }}</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -168,6 +168,8 @@ def index():
|
||||||
else:
|
else:
|
||||||
result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa
|
result['publishedDate'] = gettext(u'{hours} hour(s), {minutes} minute(s) ago').format(hours=hours, minutes=minutes) # noqa
|
||||||
else:
|
else:
|
||||||
|
# TODO using right timezone
|
||||||
|
result['pubdate'] = result['publishedDate'].strftime('%a, %d %b %Y %H:%M:%S +0000')
|
||||||
result['publishedDate'] = format_date(result['publishedDate'])
|
result['publishedDate'] = format_date(result['publishedDate'])
|
||||||
|
|
||||||
if search.request_data.get('format') == 'json':
|
if search.request_data.get('format') == 'json':
|
||||||
|
|
Loading…
Reference in New Issue