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.4.0.tar.gz (31.8 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.4.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xark-0.4.0.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xark-0.4.0.tar.gz
Algorithm Hash digest
SHA256 64ce67af1b55eb4b26fe0f6c3b6de08d3a50bd63407c2f71e8217bd92fb1a653
MD5 d620200f238d144e906d0d0f4fc38a84
BLAKE2b-256 1e3754e4811b23ec4e8cec11d28866dc774c2f622f6c40a30187e490e0f1ba5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for xark-0.4.0.tar.gz:

Publisher: publish.yml on AthM23/xark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: xark-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xark-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4e76d69b019f0f1479ea261ab7bfe5e7bc52daa042fe0c79ae1b2ac7da6a8c9
MD5 e3e2545e75299fabb37693adf520e417
BLAKE2b-256 edd2f41b6b0c16a14f465e32cf6ab8ff1af6f16d9d41eb4677fb82987638e6e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for xark-0.4.0-py3-none-any.whl:

Publisher: publish.yml on AthM23/xark

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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