See "Last updated" timestamp for this Notion note.
Step 1: Put Peter's highlights into Cloudflare KV data store
✅ Peter email Mark .csv export from Readwise
✅ Manually delete some rows in Excel to leave 1,000 to 5,000 "top" highlights – e.g., ones with an Amazon Book ID and added notes from Peter
✅ Write python script to convert to json format
✅ Copy-paste into KV UI on Cloudflare website, or user wrangler
CLI to upload to KV
Step 2: Create simple Webflow page with placeholder for "Highlight text", "Author Name", etc.
✅ Done at highlights.webflow.io/all-highlights with user [email protected]
, password musicistheanswer
Step 3: Create Cloudflare Worker that loads Webflow "template" but injects our highlights
✅ Create Cloudflare worker that reads that webflow page, and modifies it somehow (e.g., adjust title or append Div)
✅ Have worker edit the "highlight" card with the quoted text, author and note for each highlight
Clumsy: am currently reqeusting the .html (and .js and .css) from Webflow TWICE. Once to have a variable html
to manipulate; a second time to use CloudFlare's streaming html re-writer. Apparently a response can only be read once (link), and this was the first work-around I thought of. [2]
// "you can only read the body of a Request once, since it is read in a streaming way.":
// let newRequest = new Request(request, { body: formData })
const responseCopy = await fetch(url, init) // --> our second time pinging Webflow,
// just to get the html, css and js, again!
bodyCopy = await responseCopy.text();
✅ Create simple /url router for /tag/___
, /id/___
, /book/___
, /search/___
and "filter" function to filter results appropriately. (Visiting /id/123
will always just return ONE highlight card.)
✅ Rank results by ID. In Peter's Excel, I roughly put "favorite"-looking highlight first, so the lower the ID, probably the "better" the highlight (more tags, longer notes from Peter, or marked as "favorite")
✅ Deploy to https://peter.highlights.lol
Step 4: Stop :)
✅ Write up this summary so far, share on https://building.highlights.lol