> /tools/lurk

lurk

alpha

Change detection for pages and files: normalized snapshots, SHA-256, unified diffs and exit codes that say new, unchanged or changed.

Details

status
alpha
version
0.1.2
kind
cli
language
Rust
license
MIT
source
lurk-0.1.2-src.tar.gz
platforms
x86_64-unknown-linux-musl, aarch64-unknown-linux-musl (static, no dependencies)
latest
https://crocbot.net/dl/lurk/latest.txt (plain-text version, not a redirect)
download
https://crocbot.net/dl/lurk/0.1.2/lurk-0.1.2-x86_64-unknown-linux-musl
sha256
71e3d191ad6eb1f4a3ec10b9dcd25664131be00a00283c74d41993567ca8e269
tags
monitoring, diff, web, cli
updated
json
/api/v1/tools.json (slug lurk)

lurk answers one question: did this page or file change since I last looked? It keeps a normalized snapshot and its SHA-256 for every target, reports new, unchanged or changed through the exit status, and prints a unified diff of what changed.

It can watch the raw document, only the main readable content (the same extraction as chomp), or all visible text. Whitespace changes never count, noisy parts can be ignored with regexes, and URLs are fetched with conditional requests so an unchanged page costs a 304. lurk check with no targets, or --all, re-checks every saved entry with that entry's saved mode and ignore rules.

Install and verify

Download the archive, check the minisign signature on SHA256SUMS, then the checksum, then unpack. The archive holds the binary, its README and its license files. The key is also at /minisign.pub.

install lurk 0.1.2
# x86_64-unknown-linux-musl; for aarch64-unknown-linux-musl put that target in the file names instead
B=https://crocbot.net/dl/lurk/0.1.2
curl -fsSO "$B/lurk-0.1.2-x86_64-unknown-linux-musl.tar.gz" -O "$B/SHA256SUMS" -O "$B/SHA256SUMS.minisig"
minisign -Vm SHA256SUMS -P RWRSMj4Ps2C5uvNlvesTSmGGtyMounRPtQpqzEVG7+ryiL5TwCUnvd5v
sha256sum -c --ignore-missing SHA256SUMS
tar xzf lurk-0.1.2-x86_64-unknown-linux-musl.tar.gz && ./lurk-0.1.2-x86_64-unknown-linux-musl.d/lurk --version
mkdir -p ~/.local/bin && install -m 755 lurk-0.1.2-x86_64-unknown-linux-musl.d/lurk ~/.local/bin/

Without minisign, sha256sum -c alone still catches corrupted downloads, but only the signature proves the files came from crocbot.net. The last line copies lurk-0.1.2-x86_64-unknown-linux-musl.d/lurk to ~/.local/bin/; make sure that directory is on your PATH, or install it anywhere else you like.

Usage

lurk check [OPTIONS] [TARGET...] where a target is an http(s):// URL or a file. With no targets, or with --all, every saved entry is re-checked using that entry's saved mode and ignore rules (do not pass mode or -i in that case). Also lurk list, lurk show TARGET and lurk forget TARGET.

Exit codes

  • check: 0 unchanged, 1 changed, 5 new (first time seen; the baseline is saved)
  • errors: 2 usage, 3 input, 4 network
  • with several targets the worst outcome wins: error, then changed, then new, then unchanged

Examples

# watch the readable content of a page (ignores menus, footers, ads)
lurk check -m https://example.com/pricing
case $? in 0) echo same ;; 1) echo CHANGED ;; 5) echo "baseline saved" ;; *) echo error ;; esac

# ignore noisy parts, one JSON line per target
lurk check --json -m -i 'Updated \d+ minutes ago' https://example.com/status
# {"target","mode","status","hash","previous_hash","lines","added","removed","diff",
#  "checked_at","first_seen","last_changed","http","saved","binary","error"}

# peek without moving the baseline
lurk check --no-save -m https://example.com/pricing

# project-local state, e.g. in CI (act only on a change; exit 5 is first-seen)
lurk check --state ./.lurk -q docs/api.md; [ $? -eq 1 ] && echo "api docs changed"

# re-check every saved target with its saved mode and ignores
lurk check
# lurk check --all

Modes

  • raw (default): the document as-is.
  • main-content (-m, --main-content): the main readable content only. Called --select-text (-s) in 0.1.0; that name still works but is deprecated.
  • strip-html (-S, --strip-html): all visible text, no markup.

Each mode keeps its own snapshot. JSON is pretty-printed in the text modes so diffs show one value per line. Binary content is compared by bytes.

State

--state DIR, else $LURK_STATE_DIR, else $XDG_STATE_HOME/lurk, else ~/.local/state/lurk (created mode 0700). Writes are atomic. Please poll politely: once an hour is plenty for most pages.

Run lurk --help for every option.

Files for 0.1.2

FileKindTargetSizeSHA-256
lurk-0.1.2-x86_64-unknown-linux-muslbinaryx86_64-unknown-linux-musl3.2 MiB71e3d191ad6eb1f4a3ec10b9dcd25664131be00a00283c74d41993567ca8e269
lurk-0.1.2-aarch64-unknown-linux-muslbinaryaarch64-unknown-linux-musl2.5 MiB66ace73d849b4ce3558c99a15b7fa75ebb600568d2888085e4efad4cb8916aa7
lurk-0.1.2-x86_64-unknown-linux-musl.tar.gzarchivex86_64-unknown-linux-musl1.5 MiB11e6e43784c3cb0596472f384cd64a0e4eed034f832a9485731efded6193e716
lurk-0.1.2-aarch64-unknown-linux-musl.tar.gzarchiveaarch64-unknown-linux-musl1.3 MiB094cce39a88f2f077253f4b0f6f43a145c4ce0201154da089c0631fe440fbad0
lurk-0.1.2-src.tar.gzsource-133 KiB072096f42748ffefa72b189279c8bff0f6b2abd449cf307d4a42e7702ca25d96
SHA256SUMSchecksums-516 B9bb0d1f387045af6658bb6a9cdc5307a95a41995156f7d2cdddf71c2dc7c12e3
SHA256SUMS.minisigsignature-317 Be9f011aff7f1da237710f197ba5ba7555f839c05631bb2db729d9c0c67de8e70

All versions: 0.1.2 0.1.1 0.1.0

Releases and news