Permalink
Browse files

Added more error handling around other media content types in RSS feeds.

  • Loading branch information...
1 parent c54298f commit 853a398c5bb2b8fd885994273971b564222cc2e7 @voodoochild committed Feb 8, 2012
Showing with 11 additions and 8 deletions.
  1. +4 −4 microapp.xml
  2. +5 −2 readnext/views.py
  3. +1 −1 requirements.txt
  4. +1 −1 runserver.py
View
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<microapp interface-version="1" version="1.0">
- <resources>
- <resource-definition cms-path-pattern="" display-name="" name="" path=""/>
- </resources>
+<microapp name="read-next" provider="guardian.co.uk" interface-version="1" version="1.0">
+ <components>
+ <component-definition display-name="readNext" name="readNext" path="readnext" widths="620" />
+ </components>
</microapp>
View
@@ -154,8 +154,11 @@ def build_item(self, data):
media = data.findAll('media:content')
for m in media:
- if m['width'] == u'140' and m['height'] == u'84':
- article['thumbnail'] = m['url']
+ try:
+ if m['width'] == u'140' and m['height'] == u'84':
+ article['thumbnail'] = m['url']
+ except KeyError:
+ pass
return article
View
@@ -1,4 +1,4 @@
Flask
requests
-feedparser
+BeautifulSoup
simplejson
View
@@ -1,2 +1,2 @@
from readnext import app
-app.run(debug=True)
+app.run(host='0.0.0.0', debug=True)

0 comments on commit 853a398

Please sign in to comment.