Skip to content
Moolan-dPublic

About

x-article scraper and translator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

X2O - X Article Translator

A Chrome extension that captures X (Twitter) Articles, translates them via LLM, and exports to Obsidian as bilingual Markdown notes.

Features

  • One-click capture of X Articles and long posts
  • Multi-provider LLM translation (Claude, OpenAI, DeepSeek, custom)
  • Automatic image download and local asset management
  • Bilingual notes with translated + original sections
  • YAML frontmatter with metadata (author, source URL, language, tags)
  • Cinema Dark UI that follows X's theme
  • Capture history with export support

Install from Source

git clone https://github.com/Moolan-d/x2o.git
cd x2o
npm install
npm run build

Then load the .output/chrome-mv3 directory as an unpacked extension in Chrome (chrome://extensions/ > Developer mode > Load unpacked).

Configuration

Open the extension's Options page to configure:

  • LLM Provider - Claude, OpenAI, DeepSeek, or custom endpoint + API key
  • Translation - Source and target language
  • Obsidian - Local REST API URL and API token

Obsidian Setup

Install Obsidian Local REST API plugin, then set the API URL and token in the extension options.

Usage

  1. Navigate to any X Article page (x.com/user/article/...)
  2. Click the floating button (bottom-right) or use the extension popup
  3. The article is captured, translated, and saved to your Obsidian vault

Development

# Build once
npm run build

# Watch mode - rebuilds on file changes
npm run dev

# Build release zip
npm run zip

Architecture

entrypoints/
├── content.ts          # Content script - DOM scraping + FAB injection
├── background.ts       # Service worker - translation pipeline + Obsidian export
├── popup.html/ts       # Extension popup UI
└── options.html/ts     # Settings page

lib/
├── markdown.ts         # Turndown HTML→MD with X Article custom rules
├── scraper.ts          # DOM scraper for X Article pages
├── translator.ts       # Multi-provider LLM translation
├── obsidian.ts         # Obsidian Local REST API client
├── settings.ts         # Chrome storage wrapper
├── history.ts          # Capture history storage
├── theme.ts            # X theme detection
├── logger.ts           # Pipeline logger
└── types.ts            # Shared TypeScript types

components/
├── fab.ts              # Floating action button
└── toast.ts            # Toast notifications

CI/CD

  • CI: Pull requests run typecheck and build checks
  • Release: Pushes to main trigger semantic-release, which analyzes commit messages and creates a new version automatically (feat: = minor, fix: = patch)
  • Publish: New releases are zipped via wxt zip and uploaded to GitHub Releases

Tech Stack

  • WXT - Browser extension framework (Manifest V3)
  • TypeScript
  • Turndown - HTML to Markdown conversion
  • Lucide - Icons

About

x-article scraper and translator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages