diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index 8a88c166..eadbdc5c 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -480,6 +480,7 @@ class processor_text_json_diff_form(commonSettingsForm): method = SelectField('Request method', choices=valid_method, default=default_method) ignore_status_codes = BooleanField('Ignore status codes (process non-2xx status codes as normal)', default=False) check_unique_lines = BooleanField('Only trigger when unique lines appear in all history', default=False) + remove_duplicate_lines = BooleanField('Remove duplicate lines of text', default=False) sort_text_alphabetically = BooleanField('Sort text alphabetically', default=False) trim_text_whitespace = BooleanField('Trim whitespace before and after text', default=False) diff --git a/changedetectionio/processors/text_json_diff/processor.py b/changedetectionio/processors/text_json_diff/processor.py index f5a23572..2327423d 100644 --- a/changedetectionio/processors/text_json_diff/processor.py +++ b/changedetectionio/processors/text_json_diff/processor.py @@ -213,6 +213,9 @@ class perform_site_check(difference_detection_processor): if watch.get('trim_text_whitespace') and stripped_text_from_html: stripped_text_from_html = '\n'.join(line.strip() for line in stripped_text_from_html.splitlines()) + if watch.get('remove_duplicate_lines') and stripped_text_from_html: + stripped_text_from_html = '\n'.join(dict.fromkeys(line for line in stripped_text_from_html.splitlines())) + # Re #340 - return the content before the 'ignore text' was applied text_content_before_ignored_filter = stripped_text_from_html.encode('utf-8') diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 8ce3b095..bf07fa3b 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -341,8 +341,12 @@ nav
+ +