fix(subscribestar): port gallery-dl date extraction (wrapped dates) + parse canary #123

Merged
bvandeusen merged 1 commits from dev into main 2026-06-17 21:15:43 -04:00
Owner

What

Image posts wrap the post date in an <a> permalink (<div class="post-date"><a href="/posts/ID">DATE</a></div>); text-only posts don't. Our hand-written <div class="post-date">([^<]+)</div> regex matched only the unwrapped case → every image post got a null published_at and sorted to the top of the feed looking broken (cheunart).

Fix

Port gallery-dl's _data_from_post date method: take text up to the first </, then whatever follows the last > — handles both wrapped and plain. Verified against the live raw feed (all 6 dates parse, including the two previously null).

Robust logging (requested)

_parse_posts now logs per-page parse stats (posts / dated / with-body) and a WARNING canary when posts parse but none get a date/body while the raw markers ARE present — i.e. our extraction diverged from the live markup. Makes this failure class diagnosable from the worker log alone.

Test: a permalink-wrapped date parses to ISO.

CI green on dev (run 1254).

🤖 Generated with Claude Code

## What Image posts wrap the post date in an `<a>` permalink (`<div class="post-date"><a href="/posts/ID">DATE</a></div>`); text-only posts don't. Our hand-written `<div class="post-date">([^<]+)</div>` regex matched only the unwrapped case → every image post got a null `published_at` and sorted to the top of the feed looking broken (cheunart). ## Fix Port gallery-dl's `_data_from_post` date method: take text up to the first `</`, then whatever follows the last `>` — handles both wrapped and plain. Verified against the live raw feed (all 6 dates parse, including the two previously null). ## Robust logging (requested) `_parse_posts` now logs per-page parse stats (posts / dated / with-body) and a WARNING **canary** when posts parse but none get a date/body while the raw markers ARE present — i.e. our extraction diverged from the live markup. Makes this failure class diagnosable from the worker log alone. Test: a permalink-wrapped date parses to ISO. CI green on dev (run 1254). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 1 commit 2026-06-17 21:15:38 -04:00
fix(subscribestar): port gallery-dl date extraction (wrapped dates) + parse canary
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 34s
CI / integration (push) Successful in 3m15s
7f6345dccf
Image posts wrap the post date in an <a> permalink
(<div class="post-date"><a href="/posts/ID">DATE</a></div>); text-only posts
don't. Our hand-written <div class="post-date">([^<]+)</div> regex matched ONLY
the unwrapped case, so every image post got a null published_at and sorted to the
top of the feed looking broken (cheunart 2026-06-17). Port gallery-dl's
_data_from_post method: text up to the first </, then after the last > — handles
both. Verified against the live raw feed (all 6 dates now parse).

Robust logging (operator request): _parse_posts now logs per-page parse stats
(posts / dated / with-body) and a WARNING canary when posts parse but NONE get a
date or body while the raw markers are present — i.e. our extraction diverged
from the live markup. Makes this failure class diagnosable from the worker log
alone, no authed re-fetch needed.

Test: a permalink-wrapped date parses to ISO.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bvandeusen merged commit eb3231ef10 into main 2026-06-17 21:15:43 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#123