Draw the events page from the blog, and fix the broken news feed - #219
Open
slarson wants to merge 2 commits into
Open
Draw the events page from the blog, and fix the broken news feed#219slarson wants to merge 2 commits into
slarson wants to merge 2 commits into
Conversation
Tumblr put its legacy /api/read/json endpoint behind a bot challenge, so it now answers 403 for ordinary visitors. The news feed had been failing with "Unable to load news feed" on every page view. Move to the supported v2 API, which is auth-gated rather than bot-gated, using a read-only consumer key registered for the website alone - it can only read posts that are already public and cannot post, edit, or see drafts. Also fix the loading flakiness. loadFullNewsFeed() was being called twice on every page view, once from main.js and once from an inline script in news.html, so two overlapping requests raced to write the same list. The feed client now keeps at most one request per query in flight and caches results for fifteen minutes, so duplicate callers share a response instead of fighting over the DOM. Three rendering fixes came with the move to v2: species names are italicised at render time (Tumblr returns titles as plain text), a title repeated at the top of its own body is dropped, and titles derived from untitled photo posts are cut at a sentence boundary rather than a fixed width - taking care not to split "C. elegans" at its abbreviation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The events page was hand-maintained and its newest entry was July 2025. It now renders from blog posts tagged "event" (or "events" - both spellings are in use), so adding an event means writing a post rather than editing HTML. Because a post's publication date is when an event was announced rather than when it happened, a post may also carry a "date:2026-09-15" tag, or "date:2026-01-29..2026-01-30" for something spanning several days. Events dated today or later appear under "Coming up", the rest under "Recently". Malformed dates fall back to the post date instead of inventing one. The page also had a visual identity of its own that did not match anything else on the site. It now uses the same layout as the news page - sidebar index, linked headings, muted dates - so the two read as one site. Padraig's recent additions and italics fixes are carried over intact. All twenty previously hand-written events now exist as backdated posts, so listing them here as well would show each one twice. The static markup is kept in this file, commented out, as a fallback: if the blog is ever lost the full 2011-2025 history is one uncomment away. The event tagging convention is documented in TUMBLR_MIGRATION_README.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related changes: the news feed was broken in production, and the events page is now drawn from the blog instead of being hand-maintained.
Builds on @pgleeson's recent events additions and italics fixes — those are carried through intact.
The news feed was down
Tumblr has put its legacy
/api/read/jsonendpoint behind a bot challenge. It returns 403 "Checking your browser…" to ordinary visitors, sonews.htmlwas showing "Unable to load news feed" on every page view.Moved to the supported v2 API, which is auth-gated rather than bot-gated. It uses a read-only consumer key registered for the website alone — verified to return 401 on drafts, dashboard, and user info, so it can only read what is already public, and it is a different key from the one the posting tools use.
While in there:
loadFullNewsFeed()was being called twice per page view — once frommain.jsand once from an inline script innews.html— so two overlapping requests raced to write the same list. That was the intermittent loading people saw. The client now keeps at most one request per query in flight and caches for 15 minutes.Events now come from the blog
Adding an event means writing a blog post tagged
event, not editing HTML.Because a post's publication date is when an event was announced rather than when it happened, a post can also carry a date tag:
eventoreventsdate:2026-09-15date:2026-01-29..2026-01-30Events dated today or later appear under Coming up, the rest under Recently. A malformed date falls back to the post date rather than inventing one —
Date.UTCsilently rolls2026-13-99over to April 2027, so the values are round-trip validated.All 20 previously hand-written events now exist as backdated posts, and the 5 existing posts that already covered an event have been tagged. The blog now has 20 posts tagged
event, spanning 2011–2025.The static list is unlinked, not deleted
Since every one of those events is now a post, rendering the hand-written list as well would show each event twice. The markup is kept in
events.html, commented out, with a note explaining why. If the blog is ever lost or the tags removed, uncommenting restores the full 2011–2025 history with no research required.Visual consistency
The events page had its own design language — pink and purple date cards in a different typeface — that did not match anything else on the site. It now uses the same layout as the news page: sidebar index, linked headings, muted dates.
Three rendering fixes came out of this, all affecting news too:
b845983andb3aac53.". "cuts "C. elegans" in half, so the boundary detection skips single-letter abbreviations.Verification
Checked in a real browser, not just by status code:
Jun 24–28, 2023masterbefore and afterNote on two pre-existing data points
Not changed here, flagging rather than silently "fixing":
neuroinformatics2011.org/abstracts/...URL identical to the NeuroInformatics 2011 entry, which looks like an old copy-paste.Both are mirrored faithfully into the blog posts. Happy to correct both if they are errors.
🤖 Generated with Claude Code