rss - Rails - feedjira get last n news -
is there method of feedjira gets last n news rss feed? (i have looked on api find similar).
is there way of getting last n news feedjira?
it doesn't appear feedjira has option limiting number of results. now, you'll need limit them yourself. like:
limit = 5 feed = feedjira::feed.fetch_and_parse('http://velocitylabs.io/feed.xml') entries = feed.entries[0..(limit-1)] be aware
fetch_and_parsemethod inconsistent in it's return values, if not successful, may need checks around that.e.g., return 0 if url param string, hash if url param array
you might consider submitting issue , pull request project :)
Comments
Post a Comment