How prestomation/calendar-ripper works
Project type and purpose
• This is a data-driven, plugin-based CLI tool that scrapes multiple calendar sources (HTML or JSON), generates standardized iCalendar (.ics) files, and aggregates them by tags.
Main components
a. CLI Entry Point (index.ts)
b. Configuration Loader (lib/config/loader.ts + schema.ts + sources/*.yaml)
c. Ripper Base Classes (HTMLRipper, JSONRipper in lib/config)
d. Source-specific Rippers (sources/<source>/ripper.ts)
e. HTTP/Fetch Module (built into the base rippers)
f. Event Parser (parseEvents implementations)
g. Tag Aggregator (lib/tag_aggregator.ts)
h. ICS Generator & Template Renderer (lib/calendar_ripper.ts + lib/templates/index.html)
i. Output Store (output .ics files + index.html)
Relationships & data flow
• The CLI loads configuration, discovers rippers under sources/, instantiates them, fetches HTML/JSON, parses events, hands results to the tag aggregator, then invokes the calendar generator to emit .ics and the HTML index.
Architectural patterns & principles
• Plugin architecture: each ripper folder is discovered dynamically.
• Template method: base classes define the scraping workflow; subclasses implement parseEvents.
• Separation of concerns: config parsing, scraping, event aggregation, and output generation are distinct modules.
Technologies & frameworks
• Node.js / TypeScript
• @js-joda for date/time
• node-html-parser for HTML scraping
• YAML config loader