A web page changes
Checks a page on a schedule and runs the macro when its text, a price, a feed or a list changes, such as a price drop or a new listing.
When url changes
Details #
The engine checks the page every every seconds (at least 60), by a fetch that looks like a browser (the default; with signIn it is signed in) or by via: tab, a background tab while a browser is connected. The same address watched by several macros is fetched once per check. The first check only records what the page says now; set fireOnFirst to run on it too.
What is compared depends on kind: text (the page, or selector), fields (the fields recipe, as in Scrape a page into rows), feed (the page's RSS, Atom or JSON feed), list (the page's rows), status (the HTTP status) or snapshot (the accessibility tree, steadier than HTML on a page that reshuffles ids).
when picks the change: changed (the default), increased, decreased, appeared, disappeared, or new. by qualifies it (5 or 5%). feed and list fire once per new row (identified by key) with the row as the inputs: new listings, new posts, new releases. threshold ignores small changes (characters, or percent) and ignore lists selectors to drop before comparing, so a "3 minutes ago" counter or a rotating banner doesn't fire it.
The run starts with {url, before, after, diff, changedFields, at}; diff is a word diff for text ([-old-]{+new+}) and a per-field list for fields.
Errors back off, doubling up to an hour. A 429 or a challenge page pauses the watch for an hour ("Paused by the site until 14:05"); a signed-out sign-in does too, until it is refreshed. Checks that fell due while the Mac slept run when it wakes.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
every | number | Yes | Seconds between checks, at least 60. | |
url | text | Yes | Required, http or https. | |
by | any value | |||
fields | record | |||
fireOnFirst | yes / no | |||
ignore | list of text | |||
impersonate | one of | auto chrome safari none | ||
key | text | |||
kind | one of | text fields feed list status snapshot | , selector, fields, via. | |
selector | text | |||
signIn | text | , impersonate: Fetch signed in, looking like a browser. | ||
threshold | any value | |||
via | one of | fetch tab | ||
when | one of | changed increased decreased appeared disappeared new | , by, threshold, ignore, key, fireOnFirst. |
Every trigger also takes Limits: a cooldown, the first time each day, every nth time, twice within seconds, a chance, only while you are at the Mac, on one Mac, or in a State. See Limits on any trigger.
Examples #
- The page “shop.example.com/item/42” goes down
- Show a notification “Price drop”
Gotchas #
Not a stealth tool: a site that answers with a challenge stops the watch for an hour, and
via: tabis the answer.via: tabchecks are skipped while no browser is connected, and the When row says so.