Add time-based orchestration, state management, diffing and logging

- config: add overrideTime for testing (HH:MM string)
- state.ts: daily state persistence (reference, lastKnown, sentAt10)
- differ.ts: detect text changes and sold-out changes between menu snapshots
- logger.ts: append timestamped changes to logs/YYYY-MM-DD.log
- index.ts: full cron logic — before 10 log only, at 10 send TG, after 10
  send on text change; sold-out always to TG without log; exit after 14:00
- .gitignore: add state/ and logs/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
František Musil
2026-05-12 09:25:11 +02:00
parent ffa638429e
commit a37b3e848d
8 changed files with 309 additions and 35 deletions
+2
View File
@@ -14,6 +14,7 @@ export interface TelegramConfig {
export interface Config {
days: DayUrls
devMode: boolean
overrideTime: string | null
telegram: TelegramConfig
}
@@ -26,6 +27,7 @@ const config: Config = {
friday: "",
},
devMode: false,
overrideTime: null,
telegram: {
botToken: "",
chatId: "",