SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
extract publishDate from vimeo
Thomas Pointhuber993271bed30e
diff --git a/searx/engines/vimeo.py b/searx/engines/vimeo.pyindex a95c75b49..d2d2a4dd0 100644--- a/searx/engines/vimeo.py+++ b/searx/engines/vimeo.py@@ -2,6 +2,8 @@ from urllib import urlencodefrom HTMLParser import HTMLParserfrom lxml import htmlfrom xpath import extract_text+from datetime import datetime+from dateutil import parserbase_url = 'http://vimeo.com'search_url = base_url + '/search?{query}'@@ -10,6 +12,7 @@ content_xpath = Nonetitle_xpath = Noneresults_xpath = ''content_tpl = '<a href="{0}"> <img src="{2}"/> </a>'+publishedDate_xpath = './/p[@class="meta"]//attribute::datetime'# the cookie set by vimeo contains all the following values,# but only __utma seems to be requiered@@ -40,9 +43,12 @@ def response(resp):url = base_url + result.xpath(url_xpath)[0]title = p.unescape(extract_text(result.xpath(title_xpath)))thumbnail = extract_text(result.xpath(content_xpath)[0])+ publishedDate = parser.parse(extract_text(result.xpath(publishedDate_xpath)[0]))+results.append({'url': url,'title': title,'content': content_tpl.format(url, title, thumbnail),'template': 'videos.html',+ 'publishedDate': publishedDate,'thumbnail': thumbnail})return resultsdiff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.pyindex 53c8b07a7..43da93ede 100644--- a/searx/engines/yahoo_news.py+++ b/searx/engines/yahoo_news.py@@ -53,7 +53,7 @@ def response(resp):- timedelta(hours=int(timeNumbers[0]))\- timedelta(minutes=int(timeNumbers[1]))else:- publishedDate =parser.parse(publishedDate)+ publishedDate = parser.parse(publishedDate)if publishedDate.year == 1900:publishedDate = publishedDate.replace(year=datetime.now().year)