pax_global_header00006660000000000000000000000064141417076560014525gustar00rootroot0000000000000052 comment=942c24b17d496646aeb42af0b9d931877ca864bb urlwatch-2.24/000077500000000000000000000000001414170765600133055ustar00rootroot00000000000000urlwatch-2.24/.github/000077500000000000000000000000001414170765600146455ustar00rootroot00000000000000urlwatch-2.24/.github/workflows/000077500000000000000000000000001414170765600167025ustar00rootroot00000000000000urlwatch-2.24/.github/workflows/unit-tests.yml000066400000000000000000000016521414170765600215500ustar00rootroot00000000000000name: Unit Tests on: push: branches: - master pull_request: branches: - master jobs: build: name: Python runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: - 3.6 - 3.7 - 3.8 - 3.9 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install --requirement requirements.txt python -m pip install pycodestyle==2.6.0 pytest sudo apt install -y build-essential libpoppler-cpp-dev pkg-config python-dev tesseract-ocr python -m pip install pdftotext docutils pygments pytesseract pillow jq - name: Test with pytest run: pytest -v urlwatch-2.24/.gitignore000066400000000000000000000000651414170765600152760ustar00rootroot00000000000000__pycache__ .idea build *.egg-info/ venv/ dist/ *.eggurlwatch-2.24/CHANGELOG.md000066400000000000000000000416411414170765600151240ustar00rootroot00000000000000# Changelog All notable changes to this project will be documented in this file. The format mostly follows [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ## [2.24] -- 2021-11-07 ### Added - The Telegram reporter has gained two new options: - `silent`: Receive message notification without sound - `monospace`: Format message in monospace style - Support for running a subset of jobs by specifying their index on the command line ### Changed - Migrated CI pipeline from Travis CI to Github Actions - `user_visible_url` can now be specified for all job types (#654, by kongomongo) - Added a `remove-duplicate-lines` filter. - Added a `csv2text` filter. - Set envelope from (`-f` option) when sending emails using `sendmail` - It is now possible to override the HTTP `method` when `data` is set on a URL job ### Fixed - Fix UnboundLocalError when SMTP auth is enabled, but keyring is not installed (#667) ## [2.23] -- 2021-04-10 ### Added - New filter: `pretty-xml` to indent/pretty-print XML documents - New filter: `jq` to parse, transform, and extract JSON data - New reporter: `prowl` (by nitz) ### Fixed - Proper multi-line highlighting for wdiff (PR#615, by kongomongo) - Fix command-line generation for html2text (PR#619, by Eloy Paris) ## [2.22] -- 2020-12-19 ### Added - Added 'wait_until' option to browser jobs to configure how long the headless browser will wait for pages to load. - Jobs now have an optional `treat_new_as_changed` (default `false`) key that can be set, and will treat newly-found pages as changed, and display a diff from the empty string (useful for `diff_tool` or `diff_filter` with side effects) - New reporters: `discord`, `mattermost` - New key `user_visible_url` for URL jobs that can be used to show a different URL in reports (useful if the watched URL is a REST API endpoint, but the report should link to the corresponding web page) - The Markdown reporter now supports limiting the report length via the `max_length` parameter of the `submit` method. The length limiting logic is smart in the sense that it will try trimming the details first, followed by omitting them completely, followed by omitting the summary. If a part of the report is omitted, a note about this is added to the report. (PR#572, by Denis Kasak) ### Changed - Diff output is now generated more uniformly, independent of whether the input data has a trailing newline or not; if this behavior is not intended, use an external `diff_tool` (PR#550, by Adam Goldsmith) - The `--test-diff-filter` output now properly reports timestamps from the history entry instead of the current date and time (Fixes #573) - Unique GUIDs for jobs are now enforced at load time, append "#1", "#2", ... to the URLs to make them unique if you have multiple different jobs that share the same request URL (Fixes #586) - When a config, urls file or hooks file does not exist and should be edited or inited, its parent folders will be created (previously only the urlwatch configuration folder was created; Fixes #594) - Auto-matched filters now always get `None` supplied as subfilter; any custom filters must accept a `subfilter` parameter after the existing `data` parameter - Drop support for Python 3.5 ## Fixed - Make imports thread-safe: This might increase startup times a bit, as dependencies are imported on bootup instead of when first used. Importing in Python is not (yet) thread-safe, so we cannot import new modules from the worker threads reliably (Fixes #559, #601) - The Matrix reporter was improved in several ways (PR#572, by Denis Kasak): - The maximum length of the report was increase from 4096 to 16384. - The report length limiting is now implemented via the new length limiting functionality of the Markdown reporter. Previously, the report was simply trimmed at the end which could break the diff blocks and make them render incorrectly. - The diff code blocks are now tagged as diffs which will allow the diffs to be syntax highlighted as such. This doesn't yet work in Element, pending on the resolution of trentm/python-markdown2#370. ## [2.21] -- 2020-07-31 ### Added - Added `--test-reporter REPORTER` command-line option to send an example report using any configured notification service - `JobBase` now has `main_thread_enter()` and `main_thread_exit()` functions that can be overridden by subclasses to run code in the main thread before and after processing of a job (based on an initial implementation by Chenfeng Bao) ### Removed - The `--test-slack` command line option has been removed, you can test your Slack reporter configuration using `--test-reporter slack` ### Changed - The `browser` job now uses Pyppeteer instead of Requests-HTML for rendering pages while executing JavaScript; this makes JavaScript execution work properly (based on code by Chenfeng Bao) ### Fixed - Applying legacy `hooks.py` filters (broken since 2.19; reported by Maxime Werlen) ## [2.20] -- 2020-07-29 ### Added - A job can now have a `diff_filter` set, which works the same way as the normal `filter` (and has the same filters available), but applies to the `diff` output instead of the page content (can be tested with `--test-diff-filter`, needs 2 or more historic snapshots in the cache) - Documentation now has a section on the configuration settings (`--edit-config`) - New filter: ``ocr`` to convert text in images to plaintext (using Tesseract OCR) - New reporters: - ``ifttt`` to send an event to If This Then That (ifttt.com) (#512, by Florian Gaultier) - ``xmpp`` to send a message using the XMPP (Jabber) protocol (#533, by Thorben Günther) ### Changed - The `urlwatch` script (Git only) now works when run from different paths - Chunking of strings (e.g. for Slack and Telegram) now adds numbering (e.g. ` (1/2)`) to the messages (only if a message is split into multiple parts) - Unit tests have been migrated from `nose` to `pytest` and moved from `test/` to `lib/urlwatch/tests/` - The ``css`` and ``xpath`` filters now accept ``skip`` and ``maxitems`` as subfilter - The ``shellpipe`` filter now inherits all environment variables (e.g. ``$PATH``) of the ``urlwatch`` process ### Fixed - The ``html2text`` method ``lynx`` now treats any subfilters with a non-``null`` value as command-line argument ``-key value`` (previously only the value ``true`` was treated like this, and any other values were silently dropped) ## [2.19] -- 2020-07-17 ### Added - Documentation is now available at [urlwatch.readthedocs.io](https://urlwatch.readthedocs.io) and shipped in the source tarball under `docs/`; filter examples in the docs are unit-tested - New filters: - `reverse`: Reverse input items (default: line-based) with optional `separator` - `pdf2text`: Convert PDF files to plaintext (must be first filter in chain) - `shellpipe`: Filter text with arbitrary command-line utilities / shell scripts - `FilterBase` API improvements for specifying subfilters: - Add `__supported_subfilters__` for sub filter checking and `--features` output - Add `__default_subfilter__` to map value-only parameters to dict parameters, for example the `grep` filter now has a default subfilter named `re` - Support for using Redis as a cache backend via `--cache=redis://localhost:6379/` ### Fixed - Declare updated Python 3.5 dependency in `setup.py` (already a requirement since urlwatch 2.18) ### Changed - Filter improvements: - `sort`: Add `reverse` option to reverse the sorting order - `sort`: Add `separator` option to specify item separator (default is still line-based) - `beautify`: The `jsbeautifier` (for `