mirror of
https://github.com/twisterarmy/feed2twister.git
synced 2025-02-01 09:34:14 +00:00
Fixes #10
Some feeds, e.g. http://japanfocus.org/admin/site_manage/rss/recent.rss Don't have ids for items. Gracefully recover from that.
This commit is contained in:
parent
1094586ef7
commit
858c26b925
@ -102,7 +102,7 @@ def main(max_items):
|
||||
msgs = []
|
||||
|
||||
for i, e in enumerate(feed.entries):
|
||||
eid = '{0}|{1}'.format(feed_url,e.id)
|
||||
eid = '{0}|{1}'.format(feed_url,e.get('id','???'))
|
||||
|
||||
if eid in db.keys() and not args.repost_existing: # been there, done that (or not - for a reason)
|
||||
logging.debug('Skipping duplicate {0}'.format(eid))
|
||||
@ -166,8 +166,11 @@ def main(max_items):
|
||||
db[eid] = utfmsg # anydbm can't handle unicode, so it's a good thing we've also kept the utf-8 :)
|
||||
except Exception, e:
|
||||
logging.error(repr(e)) # usually not very informative :(
|
||||
try: # temporary patch
|
||||
if e.error:
|
||||
logging.error(e.error)
|
||||
except Exception,e:
|
||||
logging.error('error loggin borked %s',repr(e)) # usually not very informative :(
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user