djett41 / node-feedjett

A fast customizable RSS, ATOM, and RDF feed parser and aggregator
MIT License
5 stars 2 forks source link

option: itemLimit has no effect #4

Open busticated opened 8 years ago

busticated commented 8 years ago

hey there - thanks for putting together this lib. i was giving it a try and noticed something odd: the itemLimit option doesn't appear to do anything. i put together a quick PR w/ a failing test here --> https://github.com/djett41/node-feedjett/pull/3

poking at the code, i noticed a couple of things:

fwiw, i'm running node v4.3.1 on os-x.

hope it helps! -matt

busticated commented 8 years ago

poking around a bit more, i'm reminded of how loose the rss spec really is. in particular, it seems the order of the <channel> elements is not specified and as such you can't really be sure you won't receive <item>s first. making matters worse, <item>s themselves can be in any order.

the up-shot seems to be that attempting to retrieve a subset of the feed without buffering the whole thing gets weird quick (meta might be incomplete, no guarantee you'll get the N latest <item>s)

so, yeah, fwiw.