Use this skill to acquire source content from X/Twitter. Translation, summarization, critique, or archiving are downstream tasks; first extract the original post, thread, or Article faithfully.
What This Skill Returns
Prefer structured content over visual page scraping. A good extraction includes:
- original source URL and resolved X/Twitter URL when available
- post id, author name, screen name, timestamp, and language
- engagement metrics when available: likes, reposts, replies, quotes, views, bookmarks
- post text and linked URLs
- media references with type, URL, width, and height when available
- long-form Article title and full Article text when present
- reply-thread items when the user asks for thread or conversation context
Do not translate, summarize, or rewrite during extraction unless the user explicitly asks for that downstream output. If the user asks to translate an X URL, first extract with this skill, then translate the extracted content.
Primary Workflow
Prerequisites and privacy boundary:
- Require
uv; check withcommand -v uvand stop if it is unavailable. Do not install it implicitly. - The bundled script pins the PyPI package
twitter-cli==0.8.5and requires Python 3.10+.uvmay download the fixed dependency and a compatible Python into its cache on first run. twitter-climay reuseTWITTER_AUTH_TOKEN/TWITTER_CT0or a logged-in Arc, Chrome, Edge, Firefox, or Brave session. Tell the user before the first credentialed run and obtain approval. Never print or persist cookies or tokens.
-
Normalize the URL:
- Accept only HTTPS
x.comandtwitter.comURLs. - Reject
t.co; ask for the expanded X/Twitter URL instead of following a redirect that may target an unrelated site. - Preserve the original URL in the output metadata.
- Ignore URL query parameters when identifying the status id.
- Accept only HTTPS
-
Run the bundled extractor from this skill directory:
uv run --no-project --python 3.10 scripts/fetch_x_content.py 'https://x.com/user/status/123' --format markdown -
For machine-readable output or debugging, request JSON:
uv run --no-project --python 3.10 scripts/fetch_x_content.py 'https://x.com/user/status/123' --format json -
If the user wants a saved artifact, pass
--output:uv run --no-project --python 3.10 scripts/fetch_x_content.py 'https://x.com/user/status/123' --format markdown --output /tmp/x-content.md -
Only use browser snapshots when the structured extractor fails or when the user asks about visual layout. X pages often hide Articles behind login, so snapshots are not authoritative for long-form content.
Choosing Modes
The extractor defaults to --mode auto:
- For normal status URLs, it calls
twitter tweet --jsonand emits the main post plus available replies. - If the post contains Article fields, it emits the Article title and full Article text.
- For Article-looking URLs, it tries Article extraction first.
- It does not contact Jina Reader unless the user explicitly approves that
third-party fallback and the command includes
--allow-jina.
Use explicit modes when needed:
# Long-form Article only
uv run --no-project --python 3.10 scripts/fetch_x_content.py URL --mode article --format markdown
# Post and replies
uv run --no-project --python 3.10 scripts/fetch_x_content.py URL --mode tweet --format markdown
# Explicit Jina fallback
uv run --no-project --python 3.10 scripts/fetch_x_content.py URL --mode jina --allow-jina --format markdown
Jina Reader receives the query-free X URL and may cache or meter the request.
Use it only for public URLs after approval. The script ignores ambient
JINA_API_KEY by default; add --use-jina-api-key only when the user explicitly
authorizes use of that configured credential.
Output Guidance
When reporting extraction results to the user:
- State whether the result is a post, reply thread, Article, or fallback reader output.
- Keep the original content separate from downstream analysis.
- Preserve headings, bullet lists, blockquotes, and code-like snippets in Article text.
- If media was not downloaded, say that media URLs were collected but not downloaded.
- If extraction is partial, explicitly say what failed and which fallback was used.
For long outputs, save the Markdown to /tmp or a user-requested path and summarize the location plus key metadata in chat.
Common Failures And Fallbacks
twitter-clipackage missing: run the bundled script through the documenteduv run --no-project --python 3.10 ...command instead of callingpythondirectly.- X page requires login: do not stop at browser login; use the structured extractor.
- Article text missing in
tweetmode: rerun with--mode article. - Jina returns only a preview or fails: prefer
twitter-clidata. Jina is an explicitly authorized fallback, not the source of truth. - Rate limits or upstream X changes: return the exact command, error text, and attempted fallback so the user can decide whether to retry later.
Verification Checklist
Before treating extraction as successful, confirm at least one of these is true:
- the JSON contains
articleTitleand non-emptyarticleTextfor an Article; - the JSON contains non-empty
textfor the requested post; - the Markdown output includes source metadata and non-empty content;
- for media requests, media URLs are present or the extractor explicitly reports none.