Switch Reddit widget to RSS feeds #2

Merged
bittabola merged 1 commit from fix/reddit-rss-fallback into main 2026-10-14 10:22:51 -06:00
Owner

Reddit widgets stopped updating on 2026-10-13. Reddit now returns 403 "blocked by network security." for unauthenticated .json requests, even after the loid challenge is solved and with every cookie it sets. The widget kept showing stale posts and logged nothing.

.rss still returns 200 through the existing uTLS client.

Changes

  • The unauthenticated path fetches /r/<sub>/<sort>.rss (and search.rss) and parses it with the existing gofeed parser. The app-auth path is unchanged.
  • Removed the dead loid challenge code.
  • RSS has no score, comment count, flair, crosspost or pinned data. forum-posts.html and the card templates now hide zero points and comments. Side effect: a Hacker News or Lobsters post with 0 comments no longer shows "0 comments".
  • Reddit fetch errors are logged now.

Rate limit

Reddit allows one RSS request per minute per IP (X-Ratelimit-Used: 1, 60 s reset). When both widgets refresh together, one gets 429. It keeps its old posts, shows the notice icon, and the existing early-update backoff retries it after 1 minute, which leaves the widgets out of step.

Tests

  • New TestRedditFetchPostsFromRSS with a fixture trimmed from a real feed (link post, self post, entities, thumbnail).
  • go vet clean. Live run from the apps LXC: r/calgary returned 25 posts, the newest 19 minutes old.

🤖 Generated with Claude Code

Reddit widgets stopped updating on 2026-10-13. Reddit now returns 403 "blocked by network security." for unauthenticated `.json` requests, even after the loid challenge is solved and with every cookie it sets. The widget kept showing stale posts and logged nothing. `.rss` still returns 200 through the existing uTLS client. ## Changes - The unauthenticated path fetches `/r/<sub>/<sort>.rss` (and `search.rss`) and parses it with the existing gofeed parser. The `app-auth` path is unchanged. - Removed the dead loid challenge code. - RSS has no score, comment count, flair, crosspost or pinned data. `forum-posts.html` and the card templates now hide zero points and comments. Side effect: a Hacker News or Lobsters post with 0 comments no longer shows "0 comments". - Reddit fetch errors are logged now. ## Rate limit Reddit allows one RSS request per minute per IP (`X-Ratelimit-Used: 1`, 60 s reset). When both widgets refresh together, one gets 429. It keeps its old posts, shows the notice icon, and the existing early-update backoff retries it after 1 minute, which leaves the widgets out of step. ## Tests - New `TestRedditFetchPostsFromRSS` with a fixture trimmed from a real feed (link post, self post, entities, thumbnail). - `go vet` clean. Live run from the apps LXC: r/calgary returned 25 posts, the newest 19 minutes old. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reddit now answers unauthenticated .json requests with 403 "blocked by
network security." even after the loid challenge is solved, so the
widget silently kept showing stale posts. The .rss feeds still return
200 through the uTLS client.

- Fetch /r/<sub>/<sort>.rss (and search.rss) when app-auth is not set,
  parse with the existing gofeed parser, and drop the dead loid
  challenge code. The app-auth path still uses oauth.reddit.com JSON.
- RSS carries no score, comment count, flair or crosspost data, so the
  templates hide zero points and comments.
- Log fetch errors, since failures were previously invisible.

Reddit limits RSS to one request per minute per IP. Widgets that
refresh together get a 429, keep their old posts and retry through the
existing early-update backoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bittabola deleted branch fix/reddit-rss-fallback 2026-10-14 10:22:51 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bittabola/glance!2
No description provided.