diff options
| author | a01200356 <a01200356@itesm.mx> | 2016-01-18 11:29:45 -0600 |
|---|---|---|
| committer | a01200356 <a01200356@itesm.mx> | 2016-01-18 11:29:45 -0600 |
| commit | 51278ee0be0af0d037d467dc0e22cb844a79e5f8 (patch) | |
| tree | 135bae8477eeb9fe5eef68f784c16c9b554e54f3 /searx/engines/startpage.py | |
| parent | c2e034f52a31d4eb84b01cafb3af70ed55dad792 (diff) | |
| parent | 09b7673fbd271349b6878959bd2e1ae846981e13 (diff) | |
Merge branch 'master' of https://github.com/asciimoo/searx
Diffstat (limited to 'searx/engines/startpage.py')
| -rw-r--r-- | searx/engines/startpage.py | 8 |
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())) |