Files
muninn/sidecars/linkedin-post/README.md
T

29 lines
1.1 KiB
Markdown
Raw Normal View History

# LinkedIn Post Sidecar
A Playwright acceptance test that logs into LinkedIn with supplied credentials and creates a post.
## One-time setup
cd sidecars/linkedin-post
npm install
npx playwright install chromium
## Usage
./run.sh --email=YOUR_EMAIL --password=YOUR_PASSWORD \
--post="Your post content here" [--headed]
Prints a single JSON line to stdout and exits 0 on success, exits 1 on failure:
{"success": true, "url": "https://www.linkedin.com/posts/..."}
{"success": false, "error": "Login failed: Invalid credentials"}
## Notes
- On a failed run, Playwright retains a screenshot and trace under `test-results/` for debugging.
These are gitignored and not committed, but they persist on disk.
- LinkedIn's UI changes periodically. If posting fails, check the selectors in `tests/linkedin-post.spec.js`
and update them using: `npx playwright codegen https://www.linkedin.com/login`
- LinkedIn may show CAPTCHAs or 2FA prompts which will cause the automation to fail.
- For company pages, you may need to switch to the page after login before posting.