Skip to content

Use Reddit native oEmbed to properly embed posts with video/images#3

Merged
superterran merged 1 commit intomainfrom
claude/fix-reddit-media-sizing-bp0yC
Mar 1, 2026
Merged

Use Reddit native oEmbed to properly embed posts with video/images#3
superterran merged 1 commit intomainfrom
claude/fix-reddit-media-sizing-bp0yC

Conversation

@superterran
Copy link
Copy Markdown
Contributor

Previously Reddit links rendered a preview card showing the Reddit logo as the image and a hash-like string as the title, with no video support.

  • Add createRedditEmbed() that calls Reddit's oEmbed API (/oembed) and injects the native Reddit blockquote embed, then loads widgets.js once so Reddit's own renderer displays the actual post content (including videos) in place
  • Add getRedditTitleFromUrl() fallback that humanises the URL slug (underscores → spaces) when oEmbed fails
  • When oEmbed fails and we fall back to the preview card: strip hash-like titles and replace with the slug-derived title; also suppress the Reddit site logo from being used as the post image (only allow preview.redd.it image CDN URLs)
  • Add .reddit-embed-container CSS for the native embed wrapper

https://claude.ai/code/session_013Cj7keA9TmXV8ktD5J1v1W

Previously Reddit links rendered a preview card showing the Reddit logo
as the image and a hash-like string as the title, with no video support.

- Add createRedditEmbed() that calls Reddit's oEmbed API (/oembed) and
  injects the native Reddit blockquote embed, then loads widgets.js once
  so Reddit's own renderer displays the actual post content (including
  videos) in place
- Add getRedditTitleFromUrl() fallback that humanises the URL slug
  (underscores → spaces) when oEmbed fails
- When oEmbed fails and we fall back to the preview card: strip hash-like
  titles and replace with the slug-derived title; also suppress the
  Reddit site logo from being used as the post image (only allow
  preview.redd.it image CDN URLs)
- Add .reddit-embed-container CSS for the native embed wrapper

https://claude.ai/code/session_013Cj7keA9TmXV8ktD5J1v1W
@superterran superterran merged commit 2c239fd into main Mar 1, 2026
superterran added a commit that referenced this pull request May 4, 2026
…#24)

The Anthropic API was rejecting tool calls with "tools.0.custom.input_schema.type:
Field required" because the v4 `parameters:`/`args` API was being passed to
ai@^6, which silently ignored the schema. Updated all tool definitions to v5+
(`inputSchema:` + `.input`) and replaced `maxSteps` with `stopWhen: stepCountIs()`
so the post-creator agent loop runs to completion.

Also added a #N shortcut for replying to Looper-posted idea threads: leading
with "#3", "for #1", "idea 2", etc. resolves to the Nth draft PR in the most
recent batch (grouped by date prefix in the blog/YYYY-MM-DD-... branch name)
and routes through the existing updateBlogPost flow. Thread context is then
persisted so follow-up replies in the same thread don't need the number again.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
superterran added a commit that referenced this pull request May 4, 2026
…ts (#25)

pr-creator.js opens posts ready-for-review (commit 5ddb53c removed --draft),
but getLatestIdeaBatch was filtering on pr.draft === true so the batch came
back empty and "#3 ..." replies fell through to the slug-matching parseIntent
path, which failed to find unmerged drafts in main.

Drop the draft requirement; identify the batch purely by the blog/YYYY-MM-DD-
branch prefix instead.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants