thp / urlwatch

Watch (parts of) webpages and get notified when something changes via e-mail, on your phone or via other means. Highly configurable.
https://thp.io/2008/urlwatch/
Other
2.81k stars 352 forks source link

Reporter is called even when diff_filter returns an empty string #692

Closed SaskiaTon closed 2 years ago

SaskiaTon commented 2 years ago

I watch a site where sometimes content is added and sometimes content is removed. I am only interested in specific addings. I managed to filter what I want with "filter". Then I added the diff_filter, according to https://urlwatch.readthedocs.io/en/latest/advanced.html to:

diff_filter:
  - grep: '^[@+]'

Situation: When there is a change in the site. After filtering there are only deletions With diff_filter I filter out the deletions, because I am interested in the additions. What I expect: No alert, since there has been no change for me What happens: There is an alert with "CHANGED" and then an empty line.

I also tried the diff_filter ` - grep: '^[+]'

It appears that first it is determined by "filter" if there is a change, and if so the "diff_filter" is only applied for visualisation.

thp commented 2 years ago

This is now implemented in master using an additional configuration option (because there are use cases where one wants to have a notification even if the diff filter returns the empty string), including new documentation how to use it.