rsspls icon indicating copy to clipboard operation
rsspls copied to clipboard

Support multiple nodes for summary

Open doekman opened this issue 1 year ago • 1 comments

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.

doekman avatar Jun 02 '24 11:06 doekman

"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

wezm avatar Jun 02 '24 22:06 wezm