summaryrefslogtreecommitdiff
path: root/searx/engines/startpage.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-01-18 12:47:31 +0100
committerAdam Tauber <asciimoo@gmail.com>2016-01-18 12:47:31 +0100
commitbd22e9a3363090a5e4f851670b0650349a528749 (patch)
treeea0b4b80430ffebc7e9eaa2c28188884a7c67218 /searx/engines/startpage.py
parent6a158ca2d2c5fdec597f1025c58fad90a57312dc (diff)
[fix] pep8 compatibilty
Diffstat (limited to 'searx/engines/startpage.py')
-rw-r--r--searx/engines/startpage.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/engines/startpage.py b/searx/engines/startpage.py
index a91cafa00..52dd0b92f 100644
--- a/searx/engines/startpage.py
+++ b/searx/engines/startpage.py
@@ -90,8 +90,8 @@ def response(resp):
# check if search result starts with something like: "2 Sep 2014 ... "
if re.match("^([1-9]|[1-2][0-9]|3[0-1]) [A-Z][a-z]{2} [0-9]{4} \.\.\. ", content):
- date_pos = content.find('...')+4
- date_string = content[0:date_pos-5]
+ date_pos = content.find('...') + 4
+ date_string = content[0:date_pos - 5]
published_date = parser.parse(date_string, dayfirst=True)
# fix content string
@@ -99,8 +99,8 @@ def response(resp):
# check if search result starts with something like: "5 days ago ... "
elif re.match("^[0-9]+ days? ago \.\.\. ", content):
- date_pos = content.find('...')+4
- date_string = content[0:date_pos-5]
+ date_pos = content.find('...') + 4
+ date_string = content[0:date_pos - 5]
# calculate datetime
published_date = datetime.now() - timedelta(days=int(re.match(r'\d+', date_string).group()))