Skip to main content

watch

Polls a page on an interval, tracks which items it has already seen (in a SQLite store under the cache dir), and emits or delivers only new items.

newsworker watch URL [OPTIONS]
OptionAliasDefaultDescription
--interval-i300Seconds between polls.
--channelstdoutRepeatable destination: stdout, webhook, smtp, telegram.
--webhookPOST new items as JSON to this URL (with retry/backoff).
--smtp-recipientSMTP recipient when --channel smtp.
--telegram-chat-idTelegram chat id when --channel telegram.
--format-fjsonOutput format when using stdout.
--max-pages1Pages to follow per poll (pagination).
--max-iterations0Stop after N polls (0 = run until interrupted).
--config-c(default)Path to settings YAML.
--verbose-vfalseVerbose logging.
newsworker watch "https://example.com/news" --interval 300
newsworker watch "https://example.com/news" --channel webhook \
--webhook https://hooks.example/new --max-pages 3

The loop shuts down cleanly on Ctrl-C / SIGTERM. Use --max-iterations N to stop after N polls (handy for cron-style single runs).

See delivery for outbox guarantees and channel credentials.