Building the Author Clock
Timely Tome: How I Built a Literary Clock
"Time flies over us, but leaves its shadow behind." - Nathaniel Hawthorne
I've always loved the idea of the Author Clock, a clock that tells time through literature. Instead of numbers, it shows a quote from a book that mentions the current time.
So I built my own. I call it the Timely Tome.
It sounds simple on paper: find quotes that mention times, display them on a screen. But it turns out that teaching a computer to understand time in prose, dealing with wildly uneven data, and displaying it all on hardware that refreshes like a Kindle... that's where things get interesting.
Here's how it works.
Finding Time in Text
The first problem is deceptively hard. I needed to scan thousands of books and pull out sentences that reference a specific time of day.
You can't just Ctrl+F for "3:00." A sentence like "I waited for three hours" is a duration, not a time. "The clock struck four" , is that 4 AM or 4 PM? And "it was nearly dawn" doesn't mention a number at all, but it clearly implies a time.
I built a pipeline in Python using NLTK to process raw text from Project Gutenberg and other archives. Try the interactive visualizer below to see how the system "reads" a sentence:
How the Computer Reads (NLP Pipeline)
The system ingests raw text from thousands of books.
The old clock on the wall tic-tocked slowly, its pendulum swinging with a hypnotic rhythm. It was exactly 4:17 when she looked up from her book, startled by the sudden noise outside. The rain had begun to fall harder, drumming against the window pane. "Is it really that late?" she wondered aloud, glancing back at the pages filled with dense text.
How the pipeline works
- Raw Input: The system ingests raw text. Punctuation and formatting are messy.
- Entity Extraction: Regex and Named Entity Recognition (NER) tag potential time phrases.
- Context Window: A quote like "It was 4:17" is boring on its own. I used an LLM to expand the selection to surrounding sentences , enough to give the quote flavor and narrative context, without making it too long to fit on a small screen.
The Distribution Problem
This is where I hit a wall I didn't expect.
After scanning over 2,000 books, the data was wildly uneven. Authors don't write about every minute of the day equally , not even close.
- 4:00 PM and 8:00 AM are mentioned constantly (end of school, start of the workday).
- Midnight is a favorite for dramatic scenes.
- 4:17 AM? Almost never.
I visualized the number of quotes I found for each hour. Hover over the chart to explore:
Filling the gaps
The valleys in that chart were a real problem. If it's 3:33 AM and I have zero quotes, the clock just... breaks.
My solution: fuzzy matching. If the exact minute isn't available, the system looks for "fuzzy" time descriptions , things like "It was just past three-thirty" or "The middle of the night." I assign these to the empty slots to ensure 100% coverage across all 1,440 minutes, even if some are less precise than others.
The Hardware Reality (e-ink)
Finally, displaying the text. I chose an e-ink display (like a Kindle) because it emits no light and looks like real paper , perfect for sitting on a bookshelf.
But e-ink is physically strange compared to an LCD. It uses tiny capsules of black and white pigment, moved around by electric charges. This means it can't update instantly.
Interactive eInk Simulator
Click the screen below to trigger a "full refresh". Notice the flashing? That's how eInk clears "ghost" images.
12:34
"It was twelve thirty-four, a time of no significance..."
(Tap to Refresh)
Why does it flash?
If you've ever used an older Kindle, you've seen the screen flicker black before turning a page. That's a "full refresh" , it's clearing ghost images, the faint outlines left behind by previous text.
- Ghosting: Without a full refresh, old text bleeds through. It looks like a palimpsest (which is kind of poetic for a literary clock, but not great for readability).
- Temperature: In cold rooms, the pigment moves slower, so refresh cycles take longer.
I wrote a custom Python driver that manages all of this. It does a "quick update" (no flash) for most minutes, but forces a full refresh every 15 minutes to keep the screen crisp.
Architecture Overview
For the curious, here's the full stack that runs the clock:
Classic and modern novels scanned for time references
One quote nearly every minute of the day
Automatic refresh every minute via cron
Ultra-low power eInk display operation
Full eInk display update time
Code for anyone to see
Technical Implementation Details
💡 Did You Know?
Most Common Time: 12:00 (noon/midnight) appears in over 50 different literary contexts, from dramatic reveals to quiet reflections.
Rarest Time: 3:33 AM only appears twice in the entire corpus, both in mystery novels during crucial plot moments.
Power Efficiency: The eInk display only uses power during refresh, allowing the clock to run for weeks on a power bank.
Remote Access: nGrok tunneling means I can debug the Raspberry Pi from anywhere in the world, even on vacation!
- Frontend: Next.js (the web demo you're reading right now).
- Backend: Python scripts running on a Raspberry Pi Zero W.
- Database: A simple JSON store of processed quotes , fast lookups, no SQL overhead needed.
- Deployment: A systemd service on the Pi launches the clock on boot.
What I Learned
Building Timely Tome was an exercise in trade-offs. Precise NLP vs. processing time. Perfect data distribution vs. the reality of what authors actually write about. Beautiful hardware vs. painfully slow refresh rates.
Every engineering decision involved giving something up. But that's what makes the final product, a quiet, literary clock on my shelf, feel all the more alive.
Open Source
Want to build your own? The entire codebase, including the scraping scripts and hardware drivers, is open source. Check it out on GitHub.