URLWATCH-JOBS(5)
β¨ NAME β¨
urlwatch-jobs β bestie, this is THE page for job types and config in urlwatch. π (you're reading the urlwatch-jobs(5) manual, iykyk)
π SYNOPSIS π
urlwatch --edit
π¦ DESCRIPTION π¦
Okay so, jobs are the kinds of things that urlwatch(1) can monitor. That's the whole vibe. π
The list of jobs to run lives in the config file urls.yaml, and you open it up with the command urlwatch --edit. Each job is separated by a line containing only ---. Also, the command urlwatch --list prints the name of each job, along with its index number (1, 2, 3, ...) β and that index gets assigned automatically according to its position in the configuration file. no manual numbering, slay. β¨
While it's optional, it is highly recommended that each job starts with a name entry:
name: "This is a human-readable name/label of the job"
The following job types are available: π
π URL π
This is the main job type β it retrieves a document from a web server:
name: "urlwatch homepage"
url: "https://thp.io/2008/urlwatch/"
Required keys:
urlβ The URL to the document to watch for changes
Job-specific optional keys:
cookiesβ Cookies to send with the request (see Advanced Topics)methodβ HTTP method to use (default:GET)dataβ HTTP POST/PUT datassl_no_verifyβ Do not verify SSL certificates (true/false)ignore_cachedβ Do not use cache control (ETag/Last-Modified) values (true/false)http_proxyβ Proxy server to use for HTTP requests (might behttp://orsocks5://)https_proxyβ Proxy server to use for HTTPS requests (might behttp://orsocks5://)headersβ HTTP header to send along with the requestencodingβ Override the character encoding from the server (see Advanced Topics)timeoutβ Override the default socket timeout (see Advanced Topics)ignore_connection_errorsβ Ignore (temporary) connection errors (see Advanced Topics)ignore_http_error_codesβ List of HTTP errors to ignore (see Advanced Topics)ignore_timeout_errorsβ Do not report errors when the timeout is hitignore_too_many_redirectsβ Ignore redirect loops (see Advanced Topics)ignore_incomplete_readsβ Ignore incomplete HTTP responses (see Advanced Topics)
(Note:urlimplieskind: url)
π§ BROWSER π§
This job type is a resource-intensive variant of "URL" to handle web pages that require JavaScript to render the content being monitored. it's giving main character but at a cost, bestie. π
The optional playwright package must be installed in order to run Browser jobs (see Dependencies). You will also need to install the browsers using playwright install (see Playwright Installation at https://playwright.dev/python/docs/intro for details).
name: "A page with JavaScript"
navigate: "https://example.org/"
Required keys:
navigateβ URL to navigate to with the browser
Job-specific optional keys:
wait_untilβ Eitherload,domcontentloaded,networkidle, orcommit(see Advanced Topics)wait_forβ A CSS or XPath selector based on thehttps://playwright.dev/python/docs/locators#locate-by-css-or-xpathspec. The job will wait for the default timeout of 30 seconds.useragentβ User-Agent header used for requests (otherwise browser default is used)browserβ Eitherchromium,chrome,chrome-beta,msedge,msedge-beta,msedge-dev,firefox,webkit(must be installed withplaywright install)
Because this job uses Playwright (https://playwright.dev/python/) to render the page in a headless browser instance, it uses massively more resources than a "URL" job. Use it only on pages where url does not return the correct results. In many cases, instead of using a "Browser" job, you can use the output of an API called by the page as it loads, which contains the information you are you're looking for by using the much faster "URL" job type. π‘
(Note:navigateimplieskind: browser)
πΈ SHELL πΈ
This job type allows you to watch the output of arbitrary shell commands, which is useful for e.g. monitoring an FTP uploader folder, output of scripts that query external devices (RPi GPIO), etc... π
name: "What is in my Home Directory?"
command: "ls -al ~"
Required keys:
commandβ The shell command to execute
Job-specific optional keys:
stderrβ Change how standard error is treated, see below
(Note:commandimplieskind: shell)
π Configuring stderr behavior for shell jobs π
By default urlwatch captures stderr for error reporting (non-zero exit code), but ignores the output when the shell job exits with exit code 0. (yeah, it's picky like that π)
This behavior can be customized using the stderr key:
ignoreβ Capture stderr, report on non-zero exit code, ignore otherwise (default)urlwatchβ stderr of the shell job is sent to stderr of the urlwatch process; any error message on stderr will not be visible in the error message from the reporter (legacy default behavior of urlwatch 2.24 and older)failβ Treat the job as failed if there is any output on stderr, even with exit status0stdoutβ Merge stderr output into stdout, which means stderr output is also considered for the change detection/diff part of urlwatch (this is similar to2>&1in a shell)
For example, this job definition will make the job appear as failed, even though the script exits with exit code 0:
command: |
echo "Normal standard output."
echo "Something goes to stderr, which makes this job fail." 1>&2
exit 0
stderr: fail
On the other hand, if you want to diff both stdout and stderr of the job, use this:
command: |
echo "An important line on stdout."
echo "Another important line on stderr." 1>&2
stderr: stdout
π OPTIONAL KEYS FOR ALL JOB TYPES π
nameβ Human-readable name/label of the jobtagsβ Array of tags, or a single tag as a stringfilterβ Filters (if any) to apply to the output (can be tested with--test-filter)max_triesβ After this many sequential failed runs, the error will be reported rather than ignoreddiff_toolβ Command to a custom tool for generating diff textdiff_filterβ Filters (if any) to apply to the diff result (can be tested with--test-diff-filter)treat_new_as_changedβ Will treat jobs that don't have any historic data asCHANGEDinstead ofNEW(and create a diff for new jobs)compared_versionsβ Number of versions to compare for similaritykind(redundant) β Eitherurl,shellorbrowser. Automatically derived from the unique key (url,commandornavigate) of the job typeuser_visible_urlβ Different URL to show in reports (e.g. when watched URL is a REST API URL, and you want to show a webpage)enabledβ Can be set tofalseto disable an individual job (default istrue)
π SETTING KEYS FOR ALL JOBS AT ONCE π
The main Configuration file has a job_defaults key that can be used to configure keys for all jobs at once. β¨ one setting to rule them all β¨
See urlwatch-config(5) for how to configure job defaults.
π EXAMPLES π
See urlwatch-cookbook(7) for example job configurations. so many recipes, obsessed. π«Ά
π FILES π
$XDG_CONFIG_HOME/urlwatch/urls.yaml
β SEE ALSO β
urlwatch(1), urlwatch-intro(5), urlwatch-filters(5)
π COPYRIGHT π
2024 Thomas Perl
and that's the whole page, bestie β this was urlwatch, from the urlwatch-jobs(5) manual, dated Oct 28, 2024. go watch some URLs, you absolute icon. π
β¨
π¦ where this page comes from
- arch rolling: urlwatch 2.29-4 Β· BSD-3-Clause
- debian trixie: urlwatch 2.29-1 Β· BSD-3-Clause
- fedora 43: urlwatch 2.29-3.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: urlwatch 2.29-4.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: urlwatch 2.29
- nixpkgs unstable: urlwatch 2.29
- ubuntu questing: urlwatch 2.29-1
- ubuntu resolute: urlwatch 2.29-1build1 Β· BSD-3-Clause
- ubuntu stonking: urlwatch 2.29-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms