mirror of
https://github.com/mmattbtw/dx-finder.git
synced 2026-03-15 06:45:27 +00:00
No description
- TypeScript 100%
- thx @maid.dating - at://did:plc:uy5artej7bikgrupgx6penlw/app.bsky.feed.post/3meui7fpljsii |
||
|---|---|---|
| .cursor/rules | ||
| .gitignore | ||
| bun.lock | ||
| CLAUDE.md | ||
| index.ts | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
dx-finder
Bun + TypeScript monitor that scrapes the maimai DX location page and tracks the cabinet closest to a target location (default: Nashville, TN).
When the closest cabinet changes from the previously saved result, it sends a Discord webhook.
Setup
bun install
Configuration
Environment variables:
WEBHOOK_URL(optional): Discord webhook URL to notify when closest cabinet changes.STATE_FILE(optional): path to state JSON file. Defaults tostate/closest-cabinet.json.CHECK_INTERVAL_MINUTES(optional): how often to check. Defaults to60.TARGET_LAT(optional): target latitude. Must be set withTARGET_LON.TARGET_LON(optional): target longitude. Must be set withTARGET_LAT.TARGET_LABEL(optional): display name in logs/Discord. Defaults toNashville, TN.
Example:
export WEBHOOK_URL='https://example.com/webhook'
export STATE_FILE='state/closest-cabinet.json'
export TARGET_LAT='36.1627'
export TARGET_LON='-86.7816'
export TARGET_LABEL='Nashville, TN'
Run
bun run run
This is a long-running process. It checks once at startup, then keeps checking every hour (or your configured interval).
On first run, it initializes state and does not notify. On later runs, it compares the closest cabinet to the saved one and notifies only if changed.
Discord Message
On change, it posts a formatted Discord message with:
- summary line
- embed containing previous/new closest cabinet
- cabinet
sid, address, distance from Nashville - links to each cabinet details page
Stop with Ctrl+C (SIGINT) or SIGTERM.