Home
cd ../playbooks
Market ResearchBeginner

Twitter/X Reader

Fetch Twitter/X post content including long-form Articles — full text, author info, engagement metrics, and all embedded images downloaded locally — as clean Markdown.

5 minutes
By daymadeSource
#twitter#x#content#markdown#research

Quoting a tweet or X Article accurately means more than screenshotting it — you need the text, metrics, and images preserved. This playbook fetches it all into citable Markdown.

Who it's for: researchers, content curators, journalists, analysts

Example

"Save this X Article with its images" → Complete Markdown with the full text, engagement metrics, and all images downloaded and referenced

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Twitter Reader

Fetch Twitter/X post and article content with full media support.

## Quick Start (Recommended)

For X Articles with images, use the new fetch_article.py script:

```bash
uv run --with pyyaml python scripts/fetch_article.py <article_url> [output_dir]
```

Example:
```bash
uv run --with pyyaml python scripts/fetch_article.py \
  https://x.com/HiTw93/status/2040047268221608281 \
  ./Clippings
```

This will:
- Fetch structured data via `twitter-cli` (likes, retweets, bookmarks)
- Fetch content with images via `jina.ai` API
- Download all images to `attachments/YYYY-MM-DD-AUTHOR-TITLE/`
- Generate complete Markdown with embedded image references
- Include YAML frontmatter with metadata

### Example Output

```
Fetching: https://x.com/HiTw93/status/2040047268221608281
--------------------------------------------------
Getting metadata...
Title: 你不知道的大模型训练:原理、路径与新实践
Author: Tw93
Likes: 1648

Getting content and images...
Images: 15

Downloading 15 images...
  ✓ 01-image.jpg
  ✓ 02-image.jpg
  ...

✓ Saved: ./Clippings/2026-04-03-文章标题.md
✓ Images: ./Clippings/attachments/2026-04-03-HiTw93-.../ (15 downloaded)
```

## Alternative: Jina API (Text-only)

For simple text-only fetching without authentication:

```bash
# Single tweet
curl "https://r.jina.ai/https://x.com/USER/status/TWEET_ID" \
  -H "Authorization: Bearer ${JINA_API_KEY}"

# Batch fetching
scripts/fetch_tweets.sh url1 url2 url3
```

## Features

### Full Article Mode (fetch_article.py)
- ✅ Structured metadata (author, date, engagement metrics)
- ✅ Automatic image download (all embedded media)
- ✅ Complete Markdown with local image references
- ✅ YAML frontmatter for PKM systems
- ✅ Handles X Articles (long-form content)

### Simple Mode (Jina API)
- Text-only content
- No authentication required beyond Jina API key
- Good for quick text extraction

## Prerequisites

### For Full Article Mode
- `uv` (Python package manager)
- No additional setup (twitter-cli auto-installed)

### For Simple Mode (Jina)
```bash
export JINA_API_KEY="your_api_key_here"
# Get from https://jina.ai/
```

## Output Structure

```
output_dir/
├── YYYY-MM-DD-article-title.md       # Main Markdown file
└── attachments/
    └── YYYY-MM-DD-author-title/
        ├── 01-image.jpg
        ├── 02-image.jpg
        └── ...
```

## What Gets Returned

### Full Article Mode
- **YAML Frontmatter**: source, author, date, likes, retweets, bookmarks
- **Markdown Content**: Full article text with local image references
- **Attachments**: All downloaded images in dedicated folder

### Simple Mode
- **Title**: Post author and content preview
- **URL Source**: Original tweet link
- **Published Time**: GMT timestamp
- **Markdown Content**: Text with remote media URLs

## URL Formats Supported

- `https://x.com/USER/status/ID` (posts)
- `https://x.com/USER/article/ID` (long-form articles)
- `https://twitter.com/USER/status/ID` (legacy)

## Scripts

### fetch_article.py
Full-featured article fetcher with image download:
```bash
uv run --with pyyaml python scripts/fetch_article.py <url> [output_dir]
```

### fetch_tweet.py
Simple text-only fetcher using Jina API:
```bash
python scripts/fetch_tweet.py <tweet_url> [output_file]
```

### fetch_tweets.sh
Batch fetch multiple tweets (Jina API):
```bash
scripts/fetch_tweets.sh <url1> <url2> ...
```

## Migration from Jina API

Old workflow:
```bash
curl "https://r.jina.ai/https://x.com/..."
# Manual image extraction and download
```

New workflow:
```bash
uv run --with pyyaml python scripts/fetch_article.py <url>
# Automatic image download, complete Markdown
```

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Fetch Twitter/X post content including long-form Articles — full text, author info, engagement metrics, and all embedded images downloaded locally — as clean Markdown.

What's Inside

The template covers:

  • Quick Start (Recommended)
  • Alternative: Jina API (Text-only)
  • Features
  • Prerequisites
  • Output Structure
  • What Gets Returned

Quick Start

Step 1: Create a Project Folder

Make a dedicated folder for this workflow and open it in Claude Code.

Step 2: Download the Template

Click Download above to save the template, then drop it into your project as CLAUDE.md (or paste it into your existing one).

Step 3: Start Working

Tell Claude what you need in plain language — it will follow the template's workflow automatically. For example:

Save this X Article with its images

Claude reads the template and runs the steps for you.

$Related Playbooks

Market Research

Validate Your Business Idea

Pressure-test a business idea before you build. Uses red flags, green flags, and the 'validation happens through selling, not building' principle from The Minimalist Entrepreneur.

5 minutes
Beginner
Market Research

Voice of Customer Tracker

Build a living document of your customers' exact language from testimonials, reviews, and social mentions — organized for sales copy and positioning.

10 minutes
Intermediate
Market Research

Partnership Deck Generator

Build compelling partnership proposals in minutes by feeding Claude meeting transcripts, previous proposals, and your partnership vision.

15 minutes
Intermediate
Market Research

Proposal Factory

Store reusable proposal components — case studies, bios, pricing templates — and assemble tailored proposals without starting from scratch.

10 minutes
Intermediate
Market Research

Business Analysis Framework Toolkit

A two-phase consulting-report system: build a rigorous analysis framework from a 20+ framework catalog (SWOT, Porter's Five Forces, BCG Matrix, TAM-SAM-SOM, DCF, and more) with per-chapter data requirements, then synthesize collected data into a McKinsey-voice report under a strict no-hallucinated-numbers rule.

10 minutes
Advanced
Market Research

Ad Copy Variation Generator

Analyze winning ad patterns and generate hundreds of new variations optimized for different platforms.

5 minutes
Beginner
Market Research

AI Research Analysis

Run trustworthy qualitative analysis on interviews, surveys, and user research. Built-in guardrails prevent hallucinated quotes, generic insights, and unusable signals.

15 minutes
Intermediate
Market Research

Benchmark Due Diligence

Run adversarial due-diligence on a competitor or role-model you envy, separating marketing bubble from real signal and mapping their validated playbook onto your own resources.

15 minutes
Intermediate
Market Research

Bilibili Source Fetcher

Fetch real, citable Bilibili (B站) video metadata and danmaku — views, likes, follower counts, tags, and bullet-comments — so you never hand-type or estimate engagement numbers again.

5 minutes
Beginner
Market Research

Business Strategy Consultant

Replace expensive business consultants with 10 strategic analysis frameworks - SWOT, GTM, pricing, KPIs, and more in one toolkit.

10 minutes
Intermediate
Market Research

Business Plan Generator

Generate investor-ready business plans with market analysis, financial projections, and go-to-market strategy.

10 minutes
Intermediate
Market Research

Competitor Alerts

Configure competitor alerts.

15 minutes
Intermediate

Browse all Market Research playbooks →