aboutsummaryrefslogtreecommitdiff
path: root/feedgetter.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-09-02 09:10:39 +0200
committercedricbonhomme <devnull@localhost>2010-09-02 09:10:39 +0200
commit3e071defe4f19a36cef9194c5fc95320f9961989 (patch)
tree0a49464d55a884c6ba0723e3b129a10d5a16f72b /feedgetter.py
parentRelease 1.8. It is now easier to install pyAggr3g470r. No more need to set an... (diff)
downloadnewspipe-3e071defe4f19a36cef9194c5fc95320f9961989.tar.gz
newspipe-3e071defe4f19a36cef9194c5fc95320f9961989.tar.bz2
newspipe-3e071defe4f19a36cef9194c5fc95320f9961989.zip
Improvement of the feedgetter module. Now pyAggr3g470r tries first to get the whole article (a_feed['entries'][i].content[j].value) and in case of failure tries to get the description/summary (a_feed['entries'][i].description)
Diffstat (limited to 'feedgetter.py')
-rwxr-xr-xfeedgetter.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/feedgetter.py b/feedgetter.py
index a886f351..84fbd6c7 100755
--- a/feedgetter.py
+++ b/feedgetter.py
@@ -100,10 +100,14 @@ class FeedGetter(object):
# feed already in the base
pass
for article in a_feed['entries']:
+ description = ""
try:
- description = article.description.encode('utf-8')
- except Exception, e:
- description = ""
+ description = article.content[0].value.encode('utf-8')
+ except AttributeError:
+ try:
+ description = article.description.encode('utf-8')
+ except Exception, e:
+ description = ""
try:
self.c.execute('insert into articles values (?,?,?,?,?,?,?)', (\
bgstack15