mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 21:59:22 +02:00
[fix] pep8
This commit is contained in:
parent
1467a2e0fc
commit
b735093564
3 changed files with 26 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
from urllib import urlencode
|
||||
from json import loads
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime
|
||||
|
||||
categories = ['news']
|
||||
|
||||
|
@ -33,14 +33,18 @@ def response(resp):
|
|||
|
||||
for result in search_res['responseData']['results']:
|
||||
# S.149 (159), library.pdf
|
||||
# datetime.strptime("Mon, 10 Mar 2014 16:26:15 -0700", "%a, %d %b %Y %H:%M:%S %z")
|
||||
# datetime.strptime("Mon, 10 Mar 2014 16:26:15 -0700",
|
||||
# "%a, %d %b %Y %H:%M:%S %z")
|
||||
# publishedDate = parse(result['publishedDate'])
|
||||
publishedDate = datetime.strptime(str.join(' ',result['publishedDate'].split(None)[0:5]), "%a, %d %b %Y %H:%M:%S")
|
||||
#utc_offset = timedelta(result['publishedDate'].split(None)[5]) # local = utc + offset
|
||||
publishedDate = datetime.strptime(
|
||||
str.join(' ', result['publishedDate'].split(None)[0:5]),
|
||||
"%a, %d %b %Y %H:%M:%S")
|
||||
#utc_offset = timedelta(result['publishedDate'].split(None)[5])
|
||||
# local = utc + offset
|
||||
#publishedDate = publishedDate + utc_offset
|
||||
|
||||
results.append({'url': result['unescapedUrl'],
|
||||
'title': result['titleNoFormatting'],
|
||||
'publishedDate': publishedDate,
|
||||
'publishedDate': publishedDate,
|
||||
'content': result['content']})
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue