shire
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
main.tsx
https://sohan--6e1f22be9cc611f08df20224a6c84d84.web.val.run
Shirecal is a Val Town HTTP val that turns a JSON payload of Middle-earth events into an iCalendar (.ics) feed. The val stores events in Val Town blob storage and always serves the next upcoming instance for each event (including multi-day spans).
GET /
– Returns an.ics
file with the next occurrence of every stored event.GET /?format=json
– Returns the currently stored events as JSON.PUT /
– Replaces all stored events. Body must be JSON shaped like{ "events": ShireEvent[] }
.
interface ShireEvent {
start: string; // MM-DD
end?: string; // MM-DD (optional)
text: string; // Narrative snippet used as the calendar description
characters: string[]; // Key figures tied to the event (e.g. ["Frodo", "Sam"])
}
start
andend
are month/day strings (MM-DD
).- Leave
end
blank for single-day events. - When
end
is earlier thanstart
(e.g.12-29
to01-02
), the event wraps into the next year automatically. characters
drives the calendar event summary (Gandalf's Journey
,Frodo & Sam
, etc.). Include the central figures mentioned in the narrative.