wezm / rsspls

Generate RSS feeds from websites
https://rsspls.7bit.org/
Apache License 2.0
294 stars 10 forks source link

Support multiple nodes for summary #44

Closed doekman closed 2 months ago

doekman commented 4 months ago

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.

wezm commented 4 months ago

"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