[Question] Public API for recently fetched entries, or entries added/modified since date?
See original GitHub issueFor app I’m working on, I wish to update some feeds and do something on entries that appeared. But I’m unsure how to implement this last part and get only new entries.
Workflow I sketched so far is:
- Disable updates for all feeds in db (because there might be some I don’t wish to update)
- Start adding feeds to db 2.1. If feed already exists, enable it for updates 2.2. If feed doesn’t exist, it will be added and enabled for updates automatically
- Update feeds through
update_feeds
orupdate_feeds_iter
- ???
update_feeds
doesn’t return anything. update_feeds_iter
gives me back list of UpdateResult
, where each item will have url and counts or exception.
So, I think I can sum all the counts and ask for that many entries. Something like:
count = sum(
sum(result.value.new, result.value.updated)
for result in results
if not isinstance(result.value, ReaderError)
)
new_entries = reader.get_entries(limit=count)
But is it guaranteed that get_entries(sort='recent')
will include recently updated entry? Even if that entry originally appeared long time ago? I might be misunderstanding what it means for entry to be marked as “updated”, so any pointer on that would be helpful, too.
Perhaps I could change my workflow a little - first get monotonic timestamp, then run all the steps, and finally ask for all entries that were added or modified after timestamp. But it seems that there is no API for searching by date? search_entries
is designed for full-text search and works only on few columns.
So, my question is:
- What is the preferred way of obtaining all entries added in update call?
Counting and using
get_entries
? Callingget_entries
for everything and discarding all results that were added / modified before timestamp? Something else? - What does it mean that entry was “updated”?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
Thanks for quick merge and all your help along the way. Please take your time with next release. I can wait a few weeks until you are comfortable with releasing.
And last but not least, thank you for creating the library. It made my life so much easier. I think it does everything that I need, but if I have another improvement idea or I encounter any bug, I’ll make sure to contribute again.
@mirekdlugosz: I just resolved #193; update_feeds() can now filter feeds in all the ways get_feeds() can, including by tag.