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.1.0.tar.gz (20.2 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.1.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xark-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58ef231083b3db7fb81f1f91f60fcdc4e4c3c418b3b55cdec230780ec1f7f487
MD5 ade85701d17b7cd5bd0cb389555cef08
BLAKE2b-256 ddea015b83b8de56800c1bc6765583a29586521e807ac9d95ed11fa5821ec11f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xark-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39eae3d7b06347a195c6c3cb135e02692aea6a017ef0dd39cdcfb1bf4e144b52
MD5 1c4dde175d57d7bdc4cd36cc2d8aa5ae
BLAKE2b-256 417494a5177e0cd5330061d5c4eb4cae8d4be30cb1ce4e321ca29755b6a7f82e

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