Random themed example watches, Zulip instead of ntfy

- A fresh install generates two example watches from ARN: a themed,
  funny name (Christmas, New Year, getaway weekend, sun escape, ski week,
  Valentine's, Easter, Midsummer, bucket list), a fitting SAS award
  destination and dates at the theme's next occurrence; saved on first
  run. "New random example" regenerates the watches and keeps targets.
- Notifications: ntfy and its priority column removed (ntfy entries get
  a clear validation error); new zulip type for Zulip's Slack-compatible
  webhook, with one topic per watch
- Wider name field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Måns SivertssonandClaude Opus 5.5 committed 2026-10-13 09:01:14 +02:00
1 parent 05d1d28522
commit 06c41615b8
3 files changed
+202 -49

No files matched your search

+11 -7
View File
@@ -7,7 +7,7 @@ browser requests and it keeps working behind sas.se's Cloudflare protection.
- Any number of **watches**: origins, destinations, one travel window, cabins (Economy / Premium / Business), seats, max stops
- Finds **outbound and return** flights inside the window; optionally only alerts when both legs exist, with min/max nights
- **Gentle on sas.se**: about one request a minute, a full sweep at most every 15 minutes, backs off when refused
- Alerts via **ntfy** (phone push), **Discord**, **Slack**, any **webhook**, and desktop notifications
- Alerts via **Zulip**, **Slack**, **Discord**, any **webhook**, and desktop notifications
- Dashboard shows what is bookable now **and what you missed**: seat drops and sold-out flights
## Install
@@ -25,9 +25,13 @@ browser requests and it keeps working behind sas.se's Cloudflare protection.
## Set up
On first start the script creates two example watches from ARN with a random theme, a destination that suits it
and dates at its next occurrence – e.g. *Christmas in Rovaniemi* (20–30 Dec), *Getaway weekend in Prague* (a Friday
→ Monday a few weeks out), *Ski week in Innsbruck* (sportlov), *Valentine's escape to Paris*. Keep, edit or delete them.
In the **Config** section of the dashboard:
1. **Watches** – one row per search:
1. **Watches** – each watch is two lines of fields:
| Column | Meaning |
|---|---|
@@ -44,9 +48,9 @@ In the **Config** section of the dashboard:
| Type | URL |
|---|---|
| `ntfy` | `https://ntfy.sh/<long-random-topic>`. Install the ntfy app and subscribe to the same topic. Priority sets how loud it is |
| `discord` | A channel webhook URL |
| `zulip` | Zulip's Slack-compatible webhook: `https://<org>.zulipchat.com/api/v1/external/slack_incoming?api_key=<bot key>&stream=<channel>`. Each watch posts to a topic named after it, unless you add `&topic=…` |
| `slack` | An incoming-webhook URL |
| `discord` | A channel webhook URL |
| `webhook` | Anything; receives `POST` JSON `{title, body, watch, matches: [...]}` |
The first time the script posts to a host, Tampermonkey asks you to allow it — choose *Always allow domain*.
@@ -58,7 +62,7 @@ In the **Config** section of the dashboard:
Under the tables, **JSON – export / import / reset** holds the same config as JSON:
*Download .json* for a backup, *Load file…* or paste + *Apply JSON to tables* to restore,
*Reset to example* to start over. Nothing takes effect until you press **Save & restart**.
*New random example* to replace the watches with freshly generated ones (notification targets are kept). Nothing takes effect until you press **Save & restart**.
Unsaved edits are colour-coded until you save or discard: **yellow** = changed field, **green** = new row,
**red** = row that will be removed on save (click ↺ to keep it).
@@ -104,7 +108,7 @@ Only one tab polls at a time, so opening the dashboard twice does not double the
The script header points Tampermonkey at this repo:
```
// @version 1.3.1
// @version 1.4.0
// @updateURL https://gitea.mscloud.site/mans/sas-bonus-watch/raw/branch/main/sas-bonus-watch.user.js
// @downloadURL https://gitea.mscloud.site/mans/sas-bonus-watch/raw/branch/main/sas-bonus-watch.user.js
```
@@ -127,7 +131,7 @@ Requirements:
1. Edit `sas-bonus-watch.user.js`.
2. Run the tests: `node --test` (Node 20+).
3. **Bump `@version`** (e.g. 1.3.1 → 1.3.2). Without this, nobody gets the update.
3. **Bump `@version`** (e.g. 1.4.0 → 1.4.1). Without this, nobody gets the update.
4. Commit and push to `main`.
## Development