feat(scripts): add Playwright social posting script - #11
Open
fknfairyfloss wants to merge 3 commits into
Open
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/social-post.ts— a Playwright-based script for posting approved content to Twitter/X and LinkedIn--platform twitter|linkedin,--thread(multi-tweet with 30s delay between posts),--dry-run(fills fields without submitting), and stdin/file inputdata-testid,aria-label) for easy updates after real-world DOM validationplaywright,ts-node, andtypescriptas root devDependenciesTest plan
npx ts-node scripts/social-post.ts --helpto verify CLI parsing--dry-runon Twitter/X with a single tweet--dry-run --threadon Twitter/X with----delimited input--dry-runon LinkedIn with a single postSELECTORSobject if any have changed