Add per-watch ignored keywords (IgnoredKeywords table)

Silence Telegram alerts for listings whose title contains a keyword
configured for that watch, matched case-insensitively as a substring.

- New IgnoredKeywords table: search_url (watch key) + keyword (one per row)
- load_ignored_keywords() returns {search_url: {lowercase keywords}}, reloaded
  every notification cycle so UI edits apply immediately
- title_matches_keyword() does the case-insensitive substring check
- send_pending_notifications() now also pulls search_url on pending records;
  skip_notify=true + notified=true on a hit (still archived, no Telegram)
- Docs updated: AGENTS.md, README.md, DOCUMENTATION.md
This commit is contained in:
2026-09-13 17:50:11 +08:00
parent bcd858106d
commit 9263b91276
4 changed files with 97 additions and 14 deletions
+6 -1
View File
@@ -6,7 +6,8 @@ listing to a NocoDB base (with image URL + thumbnail), and alerts Telegram.
## How it works
- `monitor.py` runs in a Docker container on DSM, self-bootstrapping its NocoDB
schema (`Listings` + `Settings` + `IgnoredSellers` tables) and looping forever.
schema (`Listings` + `Settings` + `IgnoredSellers` + `IgnoredKeywords` tables)
and looping forever.
- Every `TICK_SECONDS` it reads the watch list from the **Settings** table and polls
each enabled watch's URL on its own `check_interval_minutes`.
- Dedupe key = `product_url` (param-less listing URL). First run per watch = seed
@@ -28,6 +29,10 @@ listing to a NocoDB base (with image URL + thumbnail), and alerts Telegram.
**IgnoredSellers** — `seller_name`. Add/remove sellers here to suppress Telegram
alerts for their listings (still archived, marked `skip_notify=true`).
**IgnoredKeywords** — `search_url` + `keyword`. Per-watch title blocklist: keyword
applies only to listings from the watch whose `Settings.url` matches `search_url`;
case-insensitive substring match against the title. Still archived.
## Run
```bash