Skip to main content

CLI tool to scrape bookmarked X Articles and export to offline Markdown

Project description

xark

CLI tool that scrapes your bookmarked X/Twitter Articles and exports them to offline Markdown files with images. Useful for archiving long-form content before bookmarks disappear.

Install

pipx install xark
xark setup

xark setup installs the Chromium browser that Playwright needs for scraping (~300MB, one-time).

Quick start

xark export --headful

This opens a browser window, logs into your X session (using your existing cookies), scrolls through your bookmarks, and exports any Articles it finds as Markdown files.

Commands

xark export

Scrape bookmarked Articles and export to Markdown.

xark export --headful              # visible browser (recommended for first run)
xark export --limit 10             # scan only 10 bookmarks
xark export --output ./my-archive  # custom output directory
xark export --dry-run              # classify bookmarks without writing files
xark export --no-save-images       # skip image downloads

xark organize

Reorganize previously exported articles into topic subfolders.

xark organize                      # auto-categorize articles
xark organize --dry-run            # preview without moving files

xark setup

Install the required Chromium browser for scraping.

xark setup

Prerequisites

  • Python 3.11+
  • An X/Twitter account with bookmarked Articles
  • A logged-in X session in your browser (the tool uses your existing session)

How it works

  1. Collect -- scrolls your X bookmarks feed and captures bookmark cards
  2. Classify -- identifies which bookmarks are Articles vs. regular posts
  3. Extract -- navigates to each Article and extracts content, images, and metadata
  4. Export -- writes Markdown files with YAML frontmatter and downloads images locally

Output structure:

x-articles-archive/
  articles/
    tech/
      2026-03-14-some-article-title.md
    business/
      2026-03-13-another-article.md
  assets/
    2026-03-14-some-article-title/
      image-01.jpg
  raw/
    2026-03-14-some-article-title.html

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xark-0.2.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xark-0.2.0-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file xark-0.2.0.tar.gz.

File metadata

  • Download URL: xark-0.2.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for xark-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1cad175dab5ae648d9b5a36c0f48ae1776754622169692df32da07a28b06aee7
MD5 134ae1e54b3035ba0b502252c0135b13
BLAKE2b-256 18d7e657ff4781947766c017118a19a6b8c21ad40bd1032ba97d2a945860d2c4

See more details on using hashes here.

File details

Details for the file xark-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xark-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for xark-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43fd28d072c26171df49195545885c0b31148029f909e46e8e4d2255303f799b
MD5 66a325cbb4ce51bff9e6bc94bb536df7
BLAKE2b-256 01bed0ffa3feb9c934c86228ff9f47ea79d7b3ae332b4c141a53145df83c4de2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page