diff options
author | cedricbonhomme <devnull@localhost> | 2010-09-02 09:10:39 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-09-02 09:10:39 +0200 |
commit | 3e071defe4f19a36cef9194c5fc95320f9961989 (patch) | |
tree | 0a49464d55a884c6ba0723e3b129a10d5a16f72b | |
parent | Release 1.8. It is now easier to install pyAggr3g470r. No more need to set an... (diff) | |
download | newspipe-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)
-rwxr-xr-x | feedgetter.py | 10 |
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 (?,?,?,?,?,?,?)', (\ |