Initial project setup: Bun + cheerio scraper with dev mode
- config/ with default + local (gitignored) merge pattern - fetcher with manual redirect tracking, cookie jar, dev mode JSON logging - cheerio parser stub ready for selectors - telegram sender - weekday-aware entry point Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
export interface DayUrls {
|
||||
monday: string
|
||||
tuesday: string
|
||||
wednesday: string
|
||||
thursday: string
|
||||
friday: string
|
||||
}
|
||||
|
||||
export interface TelegramConfig {
|
||||
botToken: string
|
||||
chatId: string
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
days: DayUrls
|
||||
devMode: boolean
|
||||
telegram: TelegramConfig
|
||||
}
|
||||
|
||||
const config: Config = {
|
||||
days: {
|
||||
monday: "",
|
||||
tuesday: "",
|
||||
wednesday: "",
|
||||
thursday: "",
|
||||
friday: "",
|
||||
},
|
||||
devMode: false,
|
||||
telegram: {
|
||||
botToken: "",
|
||||
chatId: "",
|
||||
},
|
||||
}
|
||||
|
||||
export default config
|
||||
@@ -0,0 +1,20 @@
|
||||
import defaultConfig from "./default"
|
||||
|
||||
let localConfig: Partial<typeof defaultConfig> = {}
|
||||
|
||||
try {
|
||||
const local = await import("./local")
|
||||
localConfig = local.default
|
||||
} catch {
|
||||
// no local config, that's fine
|
||||
}
|
||||
|
||||
const config = {
|
||||
...defaultConfig,
|
||||
...localConfig,
|
||||
days: { ...defaultConfig.days, ...localConfig.days },
|
||||
telegram: { ...defaultConfig.telegram, ...localConfig.telegram },
|
||||
}
|
||||
|
||||
export default config
|
||||
export type { Config, DayUrls, TelegramConfig } from "./default"
|
||||
Reference in New Issue
Block a user