Skip to content

Fix Reddit/Instagram/Threads posting from captured DOM - #69

Merged
ralyodio merged 1 commit into
masterfrom
social-selectors-from-dom
Jul 4, 2026
Merged

ralyodio merged 1 commit into
masterfrom
social-selectors-from-dom

Conversation

@ralyodio

@ralyodio ralyodio commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Using the authenticated DOM captured by #68 (sp_post.debug_html), read via Supabase — real fixes, not guesses.

Platform Captured URL Finding Fix
Reddit /r/SEO/submit/ (logged in ✅) New UI = <post-composer-title name="title"> + Lexical <div data-lexical-editor contenteditable> in <shreddit-composer>. Old [data-testid=post-content] / DraftEditor selectors are dead. Target the real elements; type via keyboard (Lexical ignores programmatic fills).
Instagram /accounts/emailsignup Logged out — but the login-wall detector didn't match that URL, so it timed out instead of prompting reconnect. Detect emailsignup/signup → flags token_expired.
Threads threads.com/ Threads moved off threads.net; the .net cookies don't authenticate on .com. Navigate to and build URLs on threads.com.
Facebook profile.php?id=… Landed on a personal profile, zero composer markers. Left as-is — a Page-vs-profile config issue, not a blind-fixable selector.

(Also: my subreddit fallback correctly picked r/SEO for the content ✅, and Reddit was genuinely logged in — the failure was purely stale selectors.)

Verification

  • tsc --noEmit clean; tests/sp/* 35/35
  • Reddit selectors are grounded in the captured DOM but the title field / submit button live in web-component shadow DOM (not in page.content()); Playwright pierces open shadow roots at runtime, so this should work — but it's the one part not 100% verifiable from the HTML alone. If it still misses, the next failure re-captures and I refine.
  • Instagram/Threads need the user to reconnect with fresh cookies for the current domain (they were logged out).

🤖 Generated with Claude Code

Used the DOM captured on failure (sp_post.debug_html) to fix selectors
against the real authenticated pages:

- Reddit: new UI renders a <post-composer-title name="title"> web component
  and a Lexical <div data-lexical-editor contenteditable> body inside
  <shreddit-composer> — the old [data-testid=post-content] / DraftEditor
  selectors were dead. Target the real elements and type via keyboard (Lexical
  ignores programmatic fills).
- Instagram: the session landed on /accounts/emailsignup (logged out) but the
  login-wall detector didn't recognize that URL, so it timed out instead of
  flagging reconnect. Detect emailsignup/signup now.
- Threads: moved from threads.net to threads.com (old domain's cookies don't
  carry) — navigate to and build URLs on threads.com.

Facebook left as-is: the captured page was a personal profile (profile.php)
with no composer markers — a config/Page issue, not a selector we can fix blind.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 7378162 into master Jul 4, 2026
8 checks passed
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.

1 participant