mirror of
https://gitlab.com/chaica/feed2toot.git
synced 2024-11-27 14:01:11 +00:00
manage feeds with missing id. fixes #13
This commit is contained in:
parent
2ca649d22e
commit
8b294a4b5b
|
@ -99,20 +99,35 @@ class Main(object):
|
||||||
# cache the ids of last rss feeds
|
# cache the ids of last rss feeds
|
||||||
if not clioptions.all:
|
if not clioptions.all:
|
||||||
for i in entries:
|
for i in entries:
|
||||||
if 'id' in i and i['id'] not in cache.getdeque():
|
if 'id' in i:
|
||||||
totweet.append(i)
|
if i['id'] not in cache.getdeque():
|
||||||
|
totweet.append(i)
|
||||||
|
elif 'guid' in i:
|
||||||
|
if i['guid'] not in cache.getdeque():
|
||||||
|
totweet.append(i)
|
||||||
|
else:
|
||||||
|
# if id or guid not in the entry, use link
|
||||||
|
if i['link'] not in cache.getdeque():
|
||||||
|
totweet.append(i)
|
||||||
else:
|
else:
|
||||||
totweet = entries
|
totweet = entries
|
||||||
|
|
||||||
for entry in totweet:
|
for entry in totweet:
|
||||||
if 'id' not in entry:
|
if 'id' in entry:
|
||||||
# malformed feed entry, skip
|
logging.debug('found feed entry {entryid}'.format(entryid=entry['id']))
|
||||||
continue
|
rss = {
|
||||||
logging.debug('found feed entry {entryid}'.format(entryid=entry['id']))
|
'id': entry['id'],
|
||||||
|
}
|
||||||
rss = {
|
elif 'guid' in entry:
|
||||||
'id': entry['id'],
|
logging.debug('found feed entry {entryid}'.format(entryid=entry['guid']))
|
||||||
}
|
rss = {
|
||||||
|
'id': entry['guid'],
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
logging.debug('found feed entry {entryid}'.format(entryid=entry['link']))
|
||||||
|
rss = {
|
||||||
|
'id': entry['link'],
|
||||||
|
}
|
||||||
|
|
||||||
severalwordsinhashtag = False
|
severalwordsinhashtag = False
|
||||||
# lets see if the rss feed has hashtag
|
# lets see if the rss feed has hashtag
|
||||||
|
|
Loading…
Reference in New Issue
Block a user