Archive web content from your email links. This skill connects to Gmail via IMAP, filters emails by a subject prefix keyword, crawls every link using Playwright (headless Chromium), converts pages to Markdown, and saves them to your OpenClaw workspace.
bash
bash references/setup.sh
This automatically installs:
playwright (Python) + Chromium browser binaryhtml2text for HTML→Markdown conversionbash
python3 references/gmail_link_archiver.py
The first run will prompt you for:
SettingDescriptionDefaultIMAP serverGmail IMAP hostimap.gmail.comIMAP portSSL port993Gmail addressYour full email address—App passwordGmail App Password (NOT your regular password)—Default mailboxIMAP folder to searchINBOXSubject prefixFilter emails whose subject starts with this—Workspace pathWhere to save Markdown files~/openclaw-workspace/mail-archive
Credentials are saved locally to ~/.config/gmail-link-archiver/config.json with 0600 permissions. They are never transmitted or logged.
Gmail App Password: You need to generate an App Password at https://myaccount.google.com/apppasswords (requires 2FA enabled).
After the first setup, subsequent runs will read credentials from the saved config:
bash
# Use saved config defaults
python3 references/gmail_link_archiver.py
# Override mailbox and prefix on the fly
python3 references/gmail_link_archiver.py --mailbox "INBOX" --subject-prefix "[Newsletter]"
# Save to a different workspace
python3 references/gmail_link_archiver.py --workspace ~/my-archive
# Limit number of links to crawl
python3 references/gmail_link_archiver.py --max-links 10
# Re-run the setup interview
python3 references/gmail_link_archiver.py --reconfigure
text
Gmail IMAP ──► Filter by Subject ──► Extract Links
│
▼
Playwright + Chromium (headless)
│
▼
HTML → Markdown (html2text)
│
▼
Save to OpenClaw Workspace
text
usage: gmail_link_archiver.py [-h] [--mailbox MAILBOX]
[--subject-prefix PREFIX]
[--workspace PATH]
[--max-links N]
[--reconfigure]
Options:
--mailbox, -m IMAP mailbox to search (default: from config)
--subject-prefix, -s Subject prefix to filter emails
--workspace, -w Directory to save Markdown files
--max-links Max number of links to crawl (default: 50)
--reconfigure Re-run the setup interview
Each crawled page is saved as a Markdown file with YAML frontmatter:
markdown
---
source: https://example.com/article
crawled_at: 2026-03-27T12:00:00Z
---
# Article Title
Article content converted to clean Markdown...
Files are named using a sanitized version of the URL plus a short hash for uniqueness.
Ask Claude to run the archiver:
"Run the Gmail Link Archiver to crawl links from my emails with subject starting with '[ReadLater]'"
Claude will execute:
bash
python3 references/gmail_link_archiver.py --subject-prefix "[ReadLater]"
Or to set up fresh:
"Set up the Gmail Link Archiver with my credentials"
bash
python3 references/gmail_link_archiver.py --reconfigure
"App password" rejected?
Playwright/Chromium issues?
bash
# Reinstall Chromium
python3 -m playwright install chromium
# Install system dependencies (Linux)
sudo python3 -m playwright install-deps chromium
No emails found?
INBOX, [Gmail]/All Mail, etc.)Permission denied on config file?
bash
chmod 600 ~/.config/gmail-link-archiver/config.json
~/.config/gmail-link-archiver/config.json0600 (owner read/write only)0700 permissions