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

feat filter entries by title or content #372

Closed

Conversation

fengkx
Copy link

@fengkx fengkx commented May 10, 2019

This pr add the feature of filter out entries using POSIX style regex. #226

It is implemented using regex support provided by PostgreSQL. Every time the feed refresh it will SET entries' status match by the filter into removed

filter

@fguillot
Copy link
Member

The build doesn't pass on Travis CI. Some linter errors...

The CI doesn't show up on GitHub (I need to fix that).

@@ -131,6 +130,22 @@ func (h *Handler) RefreshFeed(userID, feedID int64) error {
logger.Debug("[Handler:RefreshFeed] Feed #%d not modified", feedID)
}

if originalFeed.TitleFilter != "" {
if storeErr := h.store.FilterByTitle(originalFeed.UserID, originalFeed.ID, originalFeed.TitleFilter); storeErr != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to generate a lot of SQL queries. What about doing the filtering only when the feed is modified just above?

Perhaps, it could be part of the function UpdateEntries()...

Copy link
Author

@fengkx fengkx May 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea~

I have moved it into the UpdateEntries function

@fguillot
Copy link
Member

fguillot commented Jun 4, 2019

Thinking about this... the approach used by Newsboat seems more flexible: https://newsboat.org/releases/2.15/docs/newsboat.html#_killfiles

@dewey
Copy link

dewey commented Jul 8, 2019

This is probably not what you had in mind as it's not integrated in Miniflux but after reading about these killfiles @fguillot linked I quickly threw together this sidekick that can parse these files and marks matched feed items as read for my personal usage. Maybe helpful for someone else if this doesn't make it in Miniflux. Worst case it was fun writing it :)

My approach is a bit naive as it just checks Miniflux based on an interval and not when it does a new scrape.

https://github.com/dewey/miniflux-sidekick

@fguillot
Copy link
Member

Closing due to PR #826

@fguillot fguillot closed this Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants