Adding global ignore text (#339)

This commit is contained in:
dgtlmoon
2022-01-01 14:53:08 +01:00
committed by GitHub
parent 735fc2ac8e
commit 0439acacbe
6 changed files with 108 additions and 4 deletions

View File

@@ -129,11 +129,11 @@ class perform_site_check():
update_obj["last_check_status"] = fetcher.get_last_status_code()
update_obj["last_error"] = False
# If there's text to skip
# @todo we could abstract out the get_text() to handle this cleaner
if len(watch['ignore_text']):
stripped_text_from_html = self.strip_ignore_text(stripped_text_from_html, watch['ignore_text'])
text_to_ignore = watch.get('ignore_text', []) + self.datastore.data['settings']['application'].get('global_ignore_text', [])
if len(text_to_ignore):
stripped_text_from_html = self.strip_ignore_text(stripped_text_from_html, text_to_ignore)
else:
stripped_text_from_html = stripped_text_from_html.encode('utf8')