Skip to content

feat(scripts): add Playwright social posting script - #11

Open
fknfairyfloss wants to merge 3 commits into
masterfrom
agent/social-posting-script
Open

feat(scripts): add Playwright social posting script#11
fknfairyfloss wants to merge 3 commits into
masterfrom
agent/social-posting-script

Conversation

@fknfairyfloss

Copy link
Copy Markdown
Member

Summary

  • Adds scripts/social-post.ts — a Playwright-based script for posting approved content to Twitter/X and LinkedIn
  • Supports --platform twitter|linkedin, --thread (multi-tweet with 30s delay between posts), --dry-run (fills fields without submitting), and stdin/file input
  • Uses persistent Chromium browser profile for session reuse — no OAuth or API keys needed
  • Centralized selector map (data-testid, aria-label) for easy updates after real-world DOM validation
  • Adds playwright, ts-node, and typescript as root devDependencies

Test plan

  • Run npx ts-node scripts/social-post.ts --help to verify CLI parsing
  • Test --dry-run on Twitter/X with a single tweet
  • Test --dry-run --thread on Twitter/X with ----delimited input
  • Test --dry-run on LinkedIn with a single post
  • Validate selectors against live Twitter/X and LinkedIn DOM on W11 machine
  • Update selectors in SELECTORS object if any have changed
  • Test actual posting (non-dry-run) on both platforms

Your Name and others added 3 commits April 18, 2026 14:02
… LinkedIn

Adds scripts/social-post.ts for automating approved social media posts.
Supports --platform (twitter|linkedin), --thread for multi-tweet threads
with 30s delay, --dry-run mode, stdin/file input, and persistent browser
profile for session reuse. Selectors use data-testid/aria-label attributes
and are centralized for easy updates after real-world DOM testing.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
The dry-run path slept 600s waiting for Ctrl+C, and the dispatcher's
subprocess timeout is also 600s. Every driven dry run lost that race and
was recorded as failed, with the browser's own stderr stored as the
error — which pointed the investigation at Chromium rather than at the
timing. SOCIAL_POST_NO_HOLD=1 skips the hold for driven runs; an
interactive run still holds the browser open for inspection.

Change made 2026-09-02 while tracing five failed social_jobs from 08-21.
The script and the three files added with it — a root package.json,
its lockfile and scripts/tsconfig.json — existed on this branch only.
Master never carried them, and this branch was never merged.

They now live in fknfairyfloss/ambr-agent under poster/, beside
jobs/dispatch-social.py, which is the code that invokes them. Both
commits were carried across with their original authors and dates:

  56dd4d0  the April version, from 028cf60 here
  202419b  the dry-run timeout fix, from a521df3 here

Selectors change when X or LinkedIn change their DOM. That cadence has
nothing to do with the contracts application, and neither does browser
automation this repository never runs.
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