filipedeschamps / rss-feed-emitter

Super RSS News Feed aggregator written in Node.js and ES6
MIT License
1.06k stars 77 forks source link

Option to only emit new #175

Closed TobiTenno closed 4 years ago

TobiTenno commented 5 years ago

An option for only emitting events that occur after the emitter finishes starting would help reduce some startup thrashing for people that don't want to store ids.

chelog commented 5 years ago

It's pretty easy to do like so (taken from my yt comments bot):

const timeStartup = Date.now()
feed.on('message', data => {

    var time = Date.parse(data.snippet.publishedAt)
    if (time > timeStartup) {
        // post it
    }

})
TobiTenno commented 5 years ago

I already do that, it would simply be a nice option.

TobiTenno commented 4 years ago

other issues are bigger problems, i'll close this