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
- Collect -- scrolls your X bookmarks feed and captures bookmark cards
- Classify -- identifies which bookmarks are Articles vs. regular posts
- Extract -- navigates to each Article and extracts content, images, and metadata
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ce67af1b55eb4b26fe0f6c3b6de08d3a50bd63407c2f71e8217bd92fb1a653
|
|
| MD5 |
d620200f238d144e906d0d0f4fc38a84
|
|
| BLAKE2b-256 |
1e3754e4811b23ec4e8cec11d28866dc774c2f622f6c40a30187e490e0f1ba5c
|
Provenance
The following attestation bundles were made for xark-0.4.0.tar.gz:
Publisher:
publish.yml on AthM23/xark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xark-0.4.0.tar.gz -
Subject digest:
64ce67af1b55eb4b26fe0f6c3b6de08d3a50bd63407c2f71e8217bd92fb1a653 - Sigstore transparency entry: 1123099368
- Sigstore integration time:
-
Permalink:
AthM23/xark@352a4a3adb72c46934269c67e56cfc70ce69cb87 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/AthM23
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@352a4a3adb72c46934269c67e56cfc70ce69cb87 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4e76d69b019f0f1479ea261ab7bfe5e7bc52daa042fe0c79ae1b2ac7da6a8c9
|
|
| MD5 |
e3e2545e75299fabb37693adf520e417
|
|
| BLAKE2b-256 |
edd2f41b6b0c16a14f465e32cf6ab8ff1af6f16d9d41eb4677fb82987638e6e0
|
Provenance
The following attestation bundles were made for xark-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on AthM23/xark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xark-0.4.0-py3-none-any.whl -
Subject digest:
e4e76d69b019f0f1479ea261ab7bfe5e7bc52daa042fe0c79ae1b2ac7da6a8c9 - Sigstore transparency entry: 1123099385
- Sigstore integration time:
-
Permalink:
AthM23/xark@352a4a3adb72c46934269c67e56cfc70ce69cb87 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/AthM23
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@352a4a3adb72c46934269c67e56cfc70ce69cb87 -
Trigger Event:
push
-
Statement type: