Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rss Feed Filter #191

Open
Chrissi2812 opened this issue Aug 8, 2024 · 3 comments
Open

Rss Feed Filter #191

Chrissi2812 opened this issue Aug 8, 2024 · 3 comments
Milestone

Comments

@Chrissi2812
Copy link

Would be awesome to have the possibilty to filter the rss feeds on arbitary fields.

Something like this

- type: rss
  title: News
  style: horizontal-cards
  feeds:
    - url: https://feeds.bloomberg.com/markets/news.rss
      title: Bloomberg
      filters: # adding this Filter
        - field: title
          value: /Alert/i # RegEx or Just string?
        - field: category
          value: Business
    - url: https://feeds.feedburner.com/crunchyroll/rss/anime?lang=deDE
      title: Crunchyroll
      filters:
        - field: crunchyroll:seriesTitle # or just seriesTitle or extensions.seriesTitle ? Don't know how they get parsed by gofeed
          value: # Here the values should be combined by OR because they would never match both
            - /Failure Frame/i # if matched
            - Berserk of Gluttony # Exact Value
@svilenmarkov
Copy link
Member

Hey, thanks for the idea!

I've actually been thinking about this exact same thing for the last week or so. 😅 Not sure if regular expressions are the way to go or something more advanced like expr-lang/expr which would give a ton more flexibility in what you can do.

@svilenmarkov svilenmarkov added this to the v0.8.0 milestone Aug 9, 2024
@Chrissi2812
Copy link
Author

Chrissi2812 commented Aug 12, 2024

That expr-lang/expr looks way better than what I had on my mind.
And the syntax is pretty easy to understand just converted my example from above.

- type: rss
  title: News
  style: horizontal-cards
  feeds:
    - url: https://feeds.bloomberg.com/markets/news.rss
      title: Bloomberg
      filter: "{.title matches 'Alert' or .category == 'Business'}"
    - url: https://feeds.feedburner.com/crunchyroll/rss/anime?lang=deDE
      title: Crunchyroll
      filter: "{lower(.title) matches 'failure frame' or .title in ['Berserk of Gluttony'])}" # Not sure on quotes ^^

Also could be useful for other parts as well like #148

@Chrissi2812
Copy link
Author

Also could the RSSFeedItem be extended with the Item.Extensions from gofeed to filter on those extra fields aswell?

Because the cruchyroll example packs a lot of info into their own fields and they would be really helpful for filtering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants