Skip to content

wangdefou-dev/twitter-article-to-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Twitter Article to Markdown

A Claude Code Skill that saves X (Twitter) long-form articles as clean, well-formatted Markdown files.

What it does

  1. Uses gallery-dl to fetch the full article HTML and images from an X/Twitter URL
  2. Converts the HTML to clean Markdown with proper headings, paragraphs, and structure
  3. Optionally uploads images to Cloudflare R2 and embeds them in the Markdown
  4. Saves the final .md file locally for reading in Obsidian or any Markdown viewer

Quick Start

Prerequisites

  • Claude Code installed
  • Python 3 with gallery-dl, beautifulsoup4, boto3 installed
  • X/Twitter cookies exported as twitter_cookies.txt (use the Chrome extension "Get cookies.txt LOCALLY")
  • (Optional) Cloudflare R2 bucket for image hosting

Installation

Add this skill to your Claude Code:

claude install-skill https://github.com/Wangdefou/twitter-article-to-markdown

Or manually copy SKILL.md to your Claude Code skills directory.

Usage

Just tell Claude Code:

"Save this Twitter article: https://x.com/username/status/123456789"

Or use any of the trigger phrases:

  • "Save Twitter long article" (保存推特长文)
  • "Twitter article to Markdown" (推特文章转Markdown)
  • "Save X long article" (保存X长文)

Configuration

On first use, the skill will guide you through:

  1. Setting your local paths (gallery-dl, cookies, output directories)
  2. (Optional) Configuring Cloudflare R2 for image hosting

Output Format

# Article Title

Original link: https://x.com/username/status/123456789

Article content...

---

![Image](https://your-r2-domain/XArticle/123_2.jpg)

License

MIT

About

Claude Code Skill: Save X (Twitter) long-form articles as clean Markdown files

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors