You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
Apply rules more selectively; add selection options
Fixesdewey#13 - all rules in the killfile were being applied to all feeds that had any rule specified, regardless if a given rule applied to a specific feed.
Also adds the ability to set Filter Expressions involving post authors, and to list Miniflux categories instead of a specific feed URL, in killfiles.
(cherry picked from commit 80f3c3a)
This contains the URL of the feed that should be matched. It fuzzy matches the URL so if you only have one feed just use the base URL of the site. Example: `https://example.com` if the feed is on `https://example.com/rss/atom.xml`. A wildcard selector of `*` is also supported instead of the URL.
24
24
25
+
Alternately, you may specify a comma-separated list of categories whose feeds should be matched by starting the value with `category:`. Example: `category:Photos`.
26
+
25
27
### `<filterexpr>` Filter Expressions
26
28
27
29
From the [available rule set](https://newsboat.org/releases/2.15/docs/newsboat.html#_filter_language) and attributes (`Table 5. Available Attributes`) only a small subset are supported right now. These should cover most use cases already though.
@@ -30,6 +32,7 @@ From the [available rule set](https://newsboat.org/releases/2.15/docs/newsboat.h
30
32
31
33
-`title`
32
34
-`content`
35
+
-`author`
33
36
34
37
**Comparison Operators**
35
38
@@ -59,6 +62,12 @@ This one filters out all feed items that have the word `lunar` OR `moon` in ther
There are tests in `filter/` that can be used to easily test rules or add new comparison operators.
@@ -67,6 +76,8 @@ There are tests in `filter/` that can be used to easily test rules or add new co
67
76
68
77
There are the environment variables that can be set. If you want to use a local file you can set `MF_KILLFILE_PATH="~/path/to/killfile"`. A local killfile always overwrites a remote one, even if the remote killfile URL is set (`MF_KILLFILE_URL`). `MF_USERNAME`, `MF_PASSWORD` and `MF_API_ENDPOINT` are your Miniflux credentials. If `MF_REFRESH_INTERVAL` isn't set it's running on every 30 minutes of every hour (`0 30 * * * *`).
69
78
79
+
Note that `MF_KILLFILE_REFRESH_HOURS` is currently only supported for remote killfiles. You'll need to restart miniflux-sidekick to get it to recognize an updated local killfile.
// We then check if the entry title matches a rule, if it matches we set it to "read" so we don't see it any more
73
-
varmatchedEntries []int64
74
-
for_, entry:=rangeentries.Entries {
75
-
ifs.evaluateRules(entry) {
76
-
level.Info(s.l).Log("msg", "entry matches rules in the killfile", "entry_id", entry.ID, "feed_id", feed.ID)
77
-
matchedEntries=append(matchedEntries, entry.ID)
63
+
// Alt: Instead of a URL, specify "category:" followed by a comma-separated list of Miniflux categories to add a rule that affects every feed in those categories.
// We set the string we want to compare against (https://newsboat.org/releases/2.15/docs/newsboat.html#_filter_language are supported in the killfile format)
114
-
varentryTargetstring
115
-
switchtokens[1] {
116
-
case"title":
117
-
entryTarget=entry.Title
118
-
case"description":
119
-
entryTarget=entry.Content
120
-
case"author":
121
-
entryTarget=entry.Author
122
-
}
123
126
124
-
// We check what kind of comparator was given
125
-
switchtokens[2] {
126
-
case"=~", "!~":
127
-
invertFilter:=tokens[2][0] =='!'
127
+
// The next line should succeed; we tested it would when we loaded our rules
// We set the string we want to compare against (https://newsboat.org/releases/2.15/docs/newsboat.html#_filter_language are supported in the killfile format)
131
+
varentryTargetstring
132
+
switchtokens[1] {
133
+
case"title":
134
+
entryTarget=entry.Title
135
+
case"content", "description":
136
+
// include "description" for backwards compatibility with existing killfiles; nobody should be marking entries as read based on the feed's general description
0 commit comments