Skip to content

Commit

Permalink
fix feeds dates format
Browse files Browse the repository at this point in the history
  • Loading branch information
noamoss committed Jun 25, 2016
1 parent 69036b7 commit 5b3f0ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ def parse_feeds(feeds):
published_date = datetime.datetime.fromtimestamp(mktime(entry.updated_parsed)).date()

except:
published_date = u"לא ידוע"

published_date=datetime.strptime('01011980', "%d%m%Y").date()
#published_date = u"לא ידוע"
summary = BeautifulSoup(entry.summary).get_text()
if datetime.datetime.now().date() - published_date <= datetime.timedelta(relevant_days_for_feed):
results.append([feed.name, entry.title, summary, urllib.parse.quote(entry.link),published_date])
results.append([feed.name, entry.title, summary, urllib.parse.quote(entry.link),published_date.strftime('%d/%m/%Y')])
return sorted(results, key=operator.itemgetter(4), reverse=True)


Expand Down

0 comments on commit 5b3f0ff

Please sign in to comment.