custom-x-post-fetching

Fetch X post text, media, metrics, and quoted originals via embed APIs.

1|Updated Apr 3, 2021
One-click install
npx skills add https://github.com/NaoyaMiyagawa/dotfiles --skill custom-x-post-fetching-naoyamiyagawa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: custom-x-post-fetching
Source: https://github.com/NaoyaMiyagawa/dotfiles/tree/main/.ai/skills/custom-x-post-fetching
Command: npx skills add https://github.com/NaoyaMiyagawa/dotfiles --skill custom-x-post-fetching-naoyamiyagawa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, jq, and includes scripts (resource) components.

What problem does it solve? Fetching an x.com or twitter.com status URL directly fails: WebFetch returns HTTP 402 with no body, and plain curl returns ~190KB of rate-limited HTML. This Skill retrieves the actual content of an X post through read-only embed APIs, returning a few hundred bytes of clean text without authentication or API keys. ## Core Features & Use Cases - Post Content Retrieval: Accepts an x.com/twitter.com status URL, fxtwitter/vxtwitter mirror URL, or bare numeric post id, and returns the post text, author, date, media URLs, poll results, and engagement metrics. - Quote-Repost Resolution: Automatically includes the quoted original post in the same call, indented under the quoting post, so no second fetch is needed. - Provider Fallback: Queries api.fxtwitter.com first and falls back to api.vxtwitter.com, so a single provider outage does not break the fetch. - Use Case: A user pastes a tweet link and asks what it says. Run the script with the URL to get the post text and any quoted original, then quote and attribute the content accurately in your response. ## Quick Start Run the fetch-x-post.sh script with the pasted X post URL to retrieve the post's text, metrics, and any quoted original as plain text.

Frequently Asked Questions about custom-x-post-fetching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fetch the text of a tweet from its URL?

Run the fetch-x-post.sh script with the x.com or twitter.com status URL as its single argument. It extracts the numeric post id, queries the FxEmbed API, and prints the post text, author, date, media links, and metrics as plain text.

Why does fetching an x.com URL with WebFetch fail?

WebFetch on an x.com status URL returns HTTP 402 with no body, so the tweet content never arrives. Plain curl works but returns roughly 190KB of HTML and is rate-limited, which is why this script uses read-only embed APIs instead.

Does fetching X posts require an API key or authentication?

No authentication or API key is needed. The script reads posts through the public embed APIs api.fxtwitter.com and api.vxtwitter.com, requiring only curl and jq installed on the system.

Can I fetch a tweet if the author's handle changed?

Yes. The script only extracts the numeric post id from the URL and ignores the handle entirely, so a stale or renamed handle still resolves to the correct post.

What happens when a tweet is deleted or private?

The script exits non-zero with the message that the post is unavailable, meaning it was deleted, comes from a protected account, or both providers are down. In that case, ask the user to provide the content directly.

Does the script fetch replies or full threads?

No. Replies and thread siblings are deliberately out of scope. The script fetches only the single post and, when present, the quoted original of a quote-repost; an 'in reply to' line signals missing parent context.