Twitter Connector
Use this skill to run lightweight Twitter/X search and tweet-detail retrieval from this project.
What this skill does
- Performs Twitter/X search via Playwright browser automation
- Supports tweet detail retrieval by tweet URL
- Reuses saved login cookies from
scripts/twitter_cookies.json - Returns tweet results in JSON (good for follow-up analysis)
Workflow
Dependency check is built-in (auto detect + auto install):
scripts/login.pyandscripts/search.pywill automatically detect missingplaywright- If missing, they will auto-run install for
playwrightand Chromium browser - So you can run commands directly without manual dependency setup
If cookie file is missing or expired, run login first:
python3 scripts/login.py
- Run keyword search or tweet detail:
python3 scripts/search.py "QUERY" --limit 10 --sort top --json-only
python3 scripts/search.py --url "https://x.com/jack/status/20" --json-only
Search/detail parameters
QUERY(optional): search phrase, or a tweet URL (https://twitter.com/{user}/status/{id}/https://x.com/{user}/status/{id})--url(optional): explicit tweet URL for detail mode--limit(optional): number of tweets to return in search mode (default 10, clamped to 1-50)--sort(optional):top(engagement-focused) orlive(latest), search mode only--json-only(optional): prints only the JSON array (best for machine parsing)
Example commands
python3 scripts/search.py "Claude Code" --limit 8 --sort top --json-only
python3 scripts/search.py "AI agent framework" --limit 10 --sort live --json-only
python3 scripts/search.py --url "https://x.com/jack/status/20" --json-only
python3 scripts/search.py "https://twitter.com/jack/status/20" --json-only
Output shape
Each tweet entry includes:
textusertimelikesretweetsreplieslink
Output is always a JSON array:
- Search mode: up to
--limititems - Detail mode: one item when successful, otherwise
[]
Usage boundaries
- Keep usage light (personal/manual exploration)
- If login state expires, re-run
scripts/login.py - Don’t use this workflow for mass scraping