Every filter has a condition expression and a list of actions. The actions will take place if the entire condition expression evaluates to True.
When a news item arrives in the database, the filters that belong to its feed will run in order of priority. Then, any filters from the parent feed will run. If the news gets moved to a different feed, the filters belonging to that feed will run, and so forth until all of the filters finish running or the action then_stop_filters
is used.
Some conditions and actions accept an argument. Use a colon :
to separate the command name from the argument.
Combine the following functions to create a boolean expression. You can use logical operators AND, OR, NOT, XOR, as well as grouping parentheses to create complex expressions.
Conditions with no arguments:always
has_enclosure
has_text
has_url
is_read
is_recycled
anywhere_regex:pattern
enclosure_regex:pattern
text_regex:pattern
title_regex:pattern
url_regex:pattern
Note: If your argument contains spaces or parentheses, place quotation marks around the entire condition:argument so the parser doesn't them get confused with grouping. E.g. "title_regex:free stuff"
, "title_regex:(gog)"
Note: When using regular expressions, you'll have to double up your backslashes. One backslash escapes the expression parser, and the other backslash goes to your regular expression. E.g. \\d
, example\\.com
. Sorry for the inconvenience.
Each line of this field represents a single action. If the condition evaluates to True, then all of your actions will execute in order. You can not choose to execute only some of the actions — for that, create a separate filter.
You must place either then_continue_filters
or then_stop_filters
as the final action, and these must not appear anywhere except the final position.
then_continue_filters
then_stop_filters
move_to_feed:feed_id
send_to_py:path
set_read:read
set_recycled:recycled
The send_to_py
action allows you to run your own Python file with a news object. Your python file must define a function called main
that only takes one argument, the news object, and returns the integer 0 if everything goes okay. If your function does not return 0, the action will fail. See bringrss/objects.py
to see the News class.
Conditions: always Actions: set_read:yes then_stop_filters
Conditions: enclosure_regex:\\.mp3$ AND NOT (is_read OR is_recycled) Actions: send_to_py:D:\bringrss\myscripts\download_podcast.py set_read:yes then_continue_filters
Conditions: anywhere_regex:politics Actions: set_recycled:yes then_stop_filters
Conditions: (anywhere_regex:github\\.com/voussoir OR anywhere_regex:voussoir\\.net) AND NOT (is_read OR is_recycled) Actions: move_to_feed:0123456789 send_to_py:D:\bringrss\myscripts\username_mention.py then_continue_filters