Simple RSS Reader inspired by Gxxgle Reader
修订版 | 5564648cbc3142b9f9a7fb98f81a3ff53e2ebc21 (tree) |
---|---|
时间 | 2013-12-09 14:35:07 |
作者 | hylom <hylom@hylo...> |
Commiter | hylom |
fix: clash when invalid timestamp occured in RSS
@@ -0,0 +1,2 @@ | ||
1 | +0.0.7: | |
2 | + * fix: when invalid timestamp in RSS, use now() |
@@ -4,6 +4,7 @@ | ||
4 | 4 | import feedparser |
5 | 5 | import dateutil.parser |
6 | 6 | from db import FeedContent |
7 | +from datetime import datetime | |
7 | 8 | |
8 | 9 | def _get_attr(obj, attr, default=""): |
9 | 10 | try: |
@@ -37,7 +38,10 @@ class FeedFetcher(object): | ||
37 | 38 | continue |
38 | 39 | |
39 | 40 | # parse timestamp and convert UTC |
40 | - entry.timestamp = dateutil.parser.parse(entry.timestamp) | |
41 | + try: | |
42 | + entry.timestamp = dateutil.parser.parse(entry.timestamp) | |
43 | + except ValueError: | |
44 | + entry.timestamp = datetime.now() | |
41 | 45 | if entry.timestamp.tzinfo == None: |
42 | 46 | entry.timestamp = entry.timestamp.replace(tzinfo=dateutil.tz.tzutc()) |
43 | 47 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | SPEC=grrreader.spec |
2 | -VERSION=0.0.5 | |
2 | +VERSION=0.0.7 | |
3 | 3 | DIST_DIR=dist |
4 | 4 | TGZ_NAME=grrreader-$(VERSION).tar.gz |
5 | 5 |
@@ -3,7 +3,7 @@ | ||
3 | 3 | Summary: HTML-Based RSS Reader inspired by widely known discontinued reader |
4 | 4 | URL: http://hylom.net/grrreader |
5 | 5 | Name: grrreader |
6 | -Version: 0.0.5 | |
6 | +Version: 0.0.7 | |
7 | 7 | Group: Applications/Internet |
8 | 8 | Release: 1 |
9 | 9 | License: GPLv2 |
@@ -54,6 +54,9 @@ rm -rf ${RPM_BUILD_ROOT} | ||
54 | 54 | %{_sysconfdir}/cron.d/grrreader |
55 | 55 | |
56 | 56 | %changelog |
57 | +* Mon Dec 9 2013 Hiromichi Matsushima <hylom at hylom.net> - 0.0.7-1 | |
58 | + - fix: when invalid timestamp in RSS, replace to current timestamp | |
59 | + | |
57 | 60 | * Tue Jul 16 2013 Hiromichi Matsushima <hylom at hylom.net> - 0.0.5-1 |
58 | 61 | - Create RPM package |
59 | 62 |