rsspls
rsspls copied to clipboard
Support multiple nodes for summary
I would like to have the summary generated from multiple nodes. I have a case where the root node doesn't result in a good summary, but two child nodes would be a good summary.
Example:
[feed.config]
url = "https://rkzbios.nl/"
item = ".MuiGrid-grid-md-12"
heading = "span.MuiTypography-displayBlock"
link = "a"
summary = "div.jss61, div img"
#summary = "a" #this summary would not be displayed nice in my favourite rss reader
However, this doesn't work, because only the first match of summary (the dates the movie is playing) is included, but not the second match (the movie image).
Supplying the parent of the summary nodes (summary = "a") isnt' a good match, because a lot of whitespace is displayed, and also the whole summary is a link, which I really don't want.
Anyways: would this be a good idea? Thanks for rsspls anyways.
"div.jss61, div img" seems like a pretty natural way to support this.
However, this doesn't work, because only the first match of summary (the dates the movie is playing) is included
I imagine that's due to the use of select_first here:
https://github.com/wezm/rsspls/blob/d05f85000cfa3e285edb34bf9c660c668475fd80/src/feed.rs#L296
If that was changed to use select and an iterator (like the top-level item selector shown below) then multiple matches could be handled:
https://github.com/wezm/rsspls/blob/d05f85000cfa3e285edb34bf9c660c668475fd80/src/feed.rs#L97-L100