diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 88cf9795..52d6501c 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -361,7 +361,7 @@ def changedetection_app(config=None, datastore_o=None): fe.title(title=watch_title) latest_fname = watch.history[dates[-1]] - html_diff = diff.render_diff(prev_fname, latest_fname, include_equal=False, line_feed_sep="
") + html_diff = diff.render_diff(prev_fname, latest_fname, include_equal=False, line_feed_sep="
") fe.content(content="

{}

{}".format(watch_title, html_diff), type='CDATA') diff --git a/changedetectionio/diff.py b/changedetectionio/diff.py index a7215a1b..e21bfa69 100644 --- a/changedetectionio/diff.py +++ b/changedetectionio/diff.py @@ -30,7 +30,7 @@ def customSequenceMatcher(before, after, include_equal=False, include_removed=Tr yield g # only_differences - only return info about the differences, no context -# line_feed_sep could be "
" or "
  • " or "\n" etc +# line_feed_sep could be "
    " or "
  • " or "\n" etc def render_diff(previous_file, newest_file, include_equal=False, include_removed=True, include_added=True, line_feed_sep="\n"): with open(newest_file, 'r') as f: newest_version_file_contents = f.read() diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index 2eb4bdaf..be0c78cc 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -147,12 +147,12 @@ class ValidateContentFetcherIsReady(object): except urllib3.exceptions.MaxRetryError as e: driver_url = some_object.command_executor message = field.gettext('Content fetcher \'%s\' did not respond.' % (field.data)) - message += '
    ' + field.gettext( + message += '
    ' + field.gettext( 'Be sure that the selenium/webdriver runner is running and accessible via network from this container/host.') - message += '
    ' + field.gettext('Did you follow the instructions in the wiki?') - message += '

    ' + field.gettext('WebDriver Host: %s' % (driver_url)) - message += '
    Go here for more information' - message += '
    '+field.gettext('Content fetcher did not respond properly, unable to use it.\n %s' % (str(e))) + message += '
    ' + field.gettext('Did you follow the instructions in the wiki?') + message += '

    ' + field.gettext('WebDriver Host: %s' % (driver_url)) + message += '
    Go here for more information' + message += '
    '+field.gettext('Content fetcher did not respond properly, unable to use it.\n %s' % (str(e))) raise ValidationError(message) diff --git a/changedetectionio/html_tools.py b/changedetectionio/html_tools.py index 206be070..49e95663 100644 --- a/changedetectionio/html_tools.py +++ b/changedetectionio/html_tools.py @@ -8,7 +8,7 @@ import json import re # HTML added to be sure each result matching a filter (.example) gets converted to a new line by Inscriptis -TEXT_FILTER_LIST_LINE_SUFFIX = "
    " +TEXT_FILTER_LIST_LINE_SUFFIX = "
    " # 'price' , 'lowPrice', 'highPrice' are usually under here # all of those may or may not appear on different websites diff --git a/changedetectionio/notification.py b/changedetectionio/notification.py index 4b4020e2..15cc15f1 100644 --- a/changedetectionio/notification.py +++ b/changedetectionio/notification.py @@ -122,10 +122,10 @@ def process_notification(n_object, datastore): url += k + 'avatar_url=https://raw.githubusercontent.com/dgtlmoon/changedetection.io/master/changedetectionio/static/images/avatar-256x256.png' if url.startswith('tgram://'): - # Telegram only supports a limit subset of HTML, remove the '
    ' we place in. + # Telegram only supports a limit subset of HTML, remove the '
    ' we place in. # re https://github.com/dgtlmoon/changedetection.io/issues/555 # @todo re-use an existing library we have already imported to strip all non-allowed tags - n_body = n_body.replace('
    ', '\n') + n_body = n_body.replace('
    ', '\n') n_body = n_body.replace('
    ', '\n') # real limit is 4096, but minus some for extra metadata payload_max_size = 3600 diff --git a/changedetectionio/templates/_common_fields.jinja b/changedetectionio/templates/_common_fields.jinja index 4faef297..5c2abf29 100644 --- a/changedetectionio/templates/_common_fields.jinja +++ b/changedetectionio/templates/_common_fields.jinja @@ -107,7 +107,7 @@

    - URLs generated by changedetection.io (such as {{ '{{diff_url}}' }}) require the BASE_URL environment variable set.
    + URLs generated by changedetection.io (such as {{ '{{diff_url}}' }}) require the BASE_URL environment variable set.
    Your BASE_URL var is currently "{{settings_application['current_base_url']}}"
    Warning: Contents of {{ '{{diff}}' }}, {{ '{{diff_removed}}' }}, and {{ '{{diff_added}}' }} depend on how the difference algorithm perceives the change. For example, an addition or removal could be perceived as a change in some cases. More Here
    diff --git a/changedetectionio/templates/diff.html b/changedetectionio/templates/diff.html index fb40843b..fa248086 100644 --- a/changedetectionio/templates/diff.html +++ b/changedetectionio/templates/diff.html @@ -124,12 +124,12 @@
    {{ render_field(extract_form.extract_regex) }} - A RegEx is a pattern that identifies exactly which part inside of the text that you want to extract.
    + A RegEx is a pattern that identifies exactly which part inside of the text that you want to extract.

    - For example, to extract only the numbers from text ‐
    - Raw text: Temperature 5.5°C in Sydney
    - RegEx to extract: Temperature ([0-9\.]+)
    + For example, to extract only the numbers from text ‐
    + Raw text: Temperature 5.5°C in Sydney
    + RegEx to extract: Temperature ([0-9\.]+)

    Be sure to test your RegEx here. @@ -154,4 +154,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 1cbd0c40..cf9b1938 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -49,8 +49,8 @@

    {{ render_field(form.url, placeholder="https://...", required=true, class="m-d") }} - Some sites use JavaScript to create the content, for this you should use the Chrome/WebDriver Fetcher
    - You can use variables in the URL, perfect for inserting the current date and other logic, help and examples here
    + Some sites use JavaScript to create the content, for this you should use the Chrome/WebDriver Fetcher
    + You can use variables in the URL, perfect for inserting the current date and other logic, help and examples here
    {{ render_field(form.title, class="m-d") }} @@ -106,10 +106,10 @@ {{ render_field(form.webdriver_delay) }}
    If you're having trouble waiting for the page to be fully rendered (text missing etc), try increasing the 'wait' time here. -
    +
    This will wait n seconds before extracting the text. {% if using_global_webdriver_wait %} -
    Using the current global default settings +
    Using the current global default settings {% endif %}
    @@ -216,7 +216,7 @@ User-Agent: wonderbra 1.0") }}
    - Pro-tips:
    + Pro-tips:
    • Use the preview page to see your filters and triggers highlighted. @@ -241,9 +241,9 @@ xpath://body/div/span[contains(@class, 'example-class')]", %} {{ field }} {% if '/text()' in field %} - Note!: //text() function does not work where the <element> contains <![CDATA[]]>
      + Note!: //text() function does not work where the <element> contains <![CDATA[]]>
      {% endif %} - One rule per line, any rules that matches will be used.
      + One rule per line, any rules that matches will be used.
      • CSS - Limit text to this CSS rule, only text matching this CSS rule is included.
      • @@ -266,7 +266,7 @@ xpath://body/div/span[contains(@class, 'example-class')]",
      Please be sure that you thoroughly understand how to write CSS, JSONPath, XPath{% if jq_support %}, or jq selector{%endif%} rules before filing an issue on GitHub! here for more CSS selector help.
      + href="https://github.com/dgtlmoon/changedetection.io/wiki/CSS-Selector-help">here for more CSS selector help.
    @@ -334,7 +334,7 @@ Unavailable") }}
  • Extracts text in the final output (line by line) after other filters using regular expressions;
    • Regular expression ‐ example /reports.+?2022/i
    • -
    • Use //(?aiLmsux)) type flags (more information here)
    • +
    • Use //(?aiLmsux)) type flags (more information here)
    • Keyword example ‐ example Out of stock
    • Use groups to extract just that text ‐ example /reports.+?(\d+)/i returns a list of years only
    @@ -353,7 +353,7 @@ Unavailable") }}
    {% if visualselector_enabled %} - The Visual Selector tool lets you select the text elements that will be used for the change detection ‐ after the Browser Steps has completed.

    + The Visual Selector tool lets you select the text elements that will be used for the change detection ‐ after the Browser Steps has completed.

    diff --git a/changedetectionio/templates/import.html b/changedetectionio/templates/import.html index 951a8afa..6034f1ce 100644 --- a/changedetectionio/templates/import.html +++ b/changedetectionio/templates/import.html @@ -41,12 +41,12 @@
    - Copy and Paste your Distill.io watch 'export' file, this should be a JSON file.
    + Copy and Paste your Distill.io watch 'export' file, this should be a JSON file.
    This is experimental, supported fields are name, uri, tags, config:selections, the rest (including schedule) are ignored. -
    +

    - How to export? https://distill.io/docs/web-monitor/how-export-and-import-monitors/
    - Be sure to set your default fetcher to Chrome if required.
    + How to export? https://distill.io/docs/web-monitor/how-export-and-import-monitors/
    + Be sure to set your default fetcher to Chrome if required.

    diff --git a/changedetectionio/templates/preview.html b/changedetectionio/templates/preview.html index 0f05d09e..da61650d 100644 --- a/changedetectionio/templates/preview.html +++ b/changedetectionio/templates/preview.html @@ -54,7 +54,7 @@
    For now, Differences are performed on text, not graphically, only the latest screenshot is available.
    -
    +
    {% if is_html_webdriver %} {% if screenshot %}
    {{watch.snapshot_screenshot_ctime|format_timestamp_timeago}}
    @@ -67,4 +67,4 @@ {% endif %}
    -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/changedetectionio/templates/settings.html b/changedetectionio/templates/settings.html index 4e2a0316..e82e43e7 100644 --- a/changedetectionio/templates/settings.html +++ b/changedetectionio/templates/settings.html @@ -40,7 +40,7 @@
    {{ render_field(form.application.form.filter_failure_notification_threshold_attempts, class="filter_failure_notification_threshold_attempts") }} After this many consecutive times that the CSS/xPath filter is missing, send a notification -
    +
    Set to 0 to disable
    @@ -66,7 +66,7 @@ {{ render_field(form.application.form.base_url, placeholder="http://yoursite.com:5000/", class="m-d") }} - Base URL used for the {{ '{{ base_url }}' }} token in notifications and RSS links.
    Default value is the ENV var 'BASE_URL' (Currently "{{settings_application['current_base_url']}}"), + Base URL used for the {{ '{{ base_url }}' }} token in notifications and RSS links.
    Default value is the ENV var 'BASE_URL' (Currently "{{settings_application['current_base_url']}}"), read more here.
  • @@ -105,13 +105,13 @@

    Use the Basic method (default) where your watched sites don't need Javascript to render.

    The Chrome/Javascript method requires a network connection to a running WebDriver+Chrome server, set by the ENV var 'WEBDRIVER_URL'.

    -
    +
    Tip: Connect using BrightData Proxies, find out more here.
    If you're having trouble waiting for the page to be fully rendered (text missing etc), try increasing the 'wait' time here. -
    +
    This will wait n seconds before extracting the text.
    @@ -124,14 +124,14 @@
    {{ render_checkbox_field(form.application.form.ignore_whitespace) }} - Ignore whitespace, tabs and new-lines/line-feeds when considering if a change was detected.
    + Ignore whitespace, tabs and new-lines/line-feeds when considering if a change was detected.
    Note: Changing this will change the status of your existing watches, possibly trigger alerts etc.
    {{ render_checkbox_field(form.application.form.render_anchor_tag_content) }} Render anchor tag content, default disabled, when enabled renders links as (link text)[https://somesite.com] -
    +
    Note: Changing this could affect the content of your existing watches, possibly trigger alerts etc.
    @@ -151,7 +151,7 @@ nav {{ render_field(form.application.form.global_ignore_text, rows=5, placeholder="Some text to ignore in a line /some.regex\d{2}/ for case-INsensitive regex ") }} - Note: This is applied globally in addition to the per-watch rules.
    + Note: This is applied globally in addition to the per-watch rules.
    • Note: This is applied globally in addition to the per-watch rules.
    • @@ -170,8 +170,8 @@ nav
      {{ render_checkbox_field(form.application.form.api_access_token_enabled) }} -
      Restrict API access limit by using x-api-key header

      -

      API Key {{api_key}} +
      Restrict API access limit by using x-api-key header

      +

      API Key {{api_key}}
      @@ -181,7 +181,7 @@ nav

      Tip: You can connect to websites using BrightData proxies, their service WebUnlocker will solve most CAPTCHAs, whilst their Residential Proxies may help to avoid CAPTCHA altogether.

      It may be easier to try WebUnlocker first, WebUnlocker also supports country selection.

      - When you have registered, enabled the required services, visit the API example page, then select Python, set the country you wish to use, then copy+paste the example URL below
      + When you have registered, enabled the required services, visit the API example page, then select Python, set the country you wish to use, then copy+paste the example URL below
      The Proxy URL with BrightData should start with http://brd-customer...

      diff --git a/changedetectionio/tests/test_api.py b/changedetectionio/tests/test_api.py index 39690097..4fa6fa85 100644 --- a/changedetectionio/tests/test_api.py +++ b/changedetectionio/tests/test_api.py @@ -11,10 +11,10 @@ import uuid def set_original_response(): test_return_data = """ - Some initial text
      + Some initial text

      Which is across multiple lines

      -
      - So let's see what happens.
      +
      + So let's see what happens.
      Some text thats the same
      Some text that will change
      @@ -29,10 +29,10 @@ def set_original_response(): def set_modified_response(): test_return_data = """ - Some initial text
      + Some initial text

      which has this one new line

      -
      - So let's see what happens.
      +
      + So let's see what happens.
      Some text thats the same
      Some text that changes
      diff --git a/changedetectionio/tests/test_automatic_follow_ldjson_price.py b/changedetectionio/tests/test_automatic_follow_ldjson_price.py index 6f0c8ced..c95e8fcf 100644 --- a/changedetectionio/tests/test_automatic_follow_ldjson_price.py +++ b/changedetectionio/tests/test_automatic_follow_ldjson_price.py @@ -7,10 +7,10 @@ from .util import live_server_setup, extract_UUID_from_client, extract_api_key_f def set_response_with_ldjson(): test_return_data = """ - Some initial text
      + Some initial text

      Which is across multiple lines

      -
      - So let's see what happens.
      +
      + So let's see what happens.
      Some text thats the same
      Some text that will change