- commit
- 85bafe2e15511f33c8fdeadcbe40185363e92265
- parent
- 5cbc813d3ee8f8451c10605d696898218f986326
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2014-09-26 03:07
gardening
Diffstat
| M | plutopluto.py | 12 | ++++-------- |
1 files changed, 4 insertions, 8 deletions
diff --git a/plutopluto.py b/plutopluto.py
@@ -33,9 +33,7 @@ def strip_atts(s): 33 33 def parse(url): 34 34 feed = feedparser.parse(url) 35 3536 -1 entries = []37 -138 -1 for item in feed.entries:-1 36 def _parse_item(item): 39 37 d = dict() 40 38 d['dt'] = (mktime(item['published_parsed']) if 'published_parsed' in item 41 39 else int(time())) @@ -50,11 +48,11 @@ def parse(url): 50 48 d['content'] = strip_atts(unicode(head) + ' ' + unicode(img)) 51 49 else: 52 50 d['content'] = strip_atts(item['description'])53 -1 entries.append(d)-1 51 return d 54 52 55 53 return { 56 54 'url': url,57 -1 'entries': entries,-1 55 'entries': map(_parse_item, feed.entries), 58 56 } 59 57 60 58 @@ -85,9 +83,7 @@ def _parse(): 85 83 @app.route('/', methods=['GET']) 86 84 def index(): 87 85 with open(os.path.join(app.root_path, 'index.html')) as fh:88 -1 html = fh.read()89 -190 -1 return html-1 86 return fh.read() 91 87 92 88 93 89 @app.route('/config', methods=['GET'])