SuperAPI AI Directory

wechat-article-fetcher

Writing & research

View repository

Updated 10-16 08:43

About this skill

wechat-article-fetcher WeChat Official Account article fetching skill

📖 Skill Overview

Specifically used to scrape public articles from WeChat Official Accounts, automatically convert them into standard Markdown format, automatically download all images locally and replace them with relative paths, and generate Front Matter metadata that complies with Obsidian specifications, so they can be imported directly into a knowledge base.

🎯 Applicable Scenarios

  • 📚 Collecting materials for personal knowledge management
  • 💾 Local backup of WeChat Official Account articles
  • 📱 Preparing materials for offline reading
  • 🗃️ Batch import into knowledge bases such as Obsidian/Notion
  • 🏷️ Categorize and archive WeChat Official Account articles

🔧 Dependency Installation

Environment Requirements

  • Node.js >= 14.0.0
  • Operating system: compatible with Windows / Linux / macOS across all platforms

Installation Steps

# 进入技能目录
cd skills/wechat-article-fetcher

# 安装依赖
npm install

🚀 Usage

# 命令格式
node scripts/fetch.js <微信文章URL> [领域分类]

Parameter Description

Parameter Type Required Description
WeChat article URL string Yes Format is https://mp.weixin.qq.com/s/xxx public article link
Domain category string No Article category tag, such as: AI, Life, Policy, Finance, Technology, etc. If not provided, there is no category tag

Usage Example

# 示例1:无分类,文件名不加前缀,标签只有「摘录」,自动使用文章前150字作为摘要
node scripts/fetch.js https://mp.weixin.qq.com/s/F7nGnSfCLHbBwp2h0QX5tg

# 示例2:指定分类为「生活」,文件名为「生活-xxx.md」,标签增加「生活」
node scripts/fetch.js https://mp.weixin.qq.com/s/F7nGnSfCLHbBwp2h0QX5tg 生活

# 示例3:指定分类为「AI」,文件名为「AI-xxx.md」,标签增加「AI」
node scripts/fetch.js https://mp.weixin.qq.com/s/xxx AI

📂 Output Description

Cross-platform path auto-adaptation

  • Windows:C:\Users\用户名\AppData\Local\Temp\wechat-article\wechat-article-[时间戳]\
  • Linux / macOS:/tmp/wechat-article/wechat-article-[时间戳]/

Directory Structure

wechat-article-1773845896874/
├── 生活-一组零成本小技巧保护你宝贵的专注力.md  # Markdown文件:[分类]-[文章标题].md
└── attachments/                                  # 图片资源目录
    ├── img-1.jpg
    ├── img-2.png
    └── ...

Markdown File Format

Obsidian-standard Front Matter is automatically generated at the beginning of the file:

---
title: 文章标题
source: 原文链接
author:
  - "[[作者名称]]" # 有作者时显示此行,无作者则省略
published: XX公众号 微信公众号
created: 2026-03-18
description: 文章前150字纯文本摘要
tags:
  - 摘录
  - 分类标签 # 仅当传入领域分类参数时显示此行
---

The body directly preserves the original layout: headings, paragraphs, lists, quotes, links, images, and other structures remain intact.

✨ Core Features

✅ No login required: disguises the WeChat client UA to bypass PC-side access restrictions, with no QR code login required ✅ Native Obsidian adaptation: automatically generates standard Front Matter, which can be imported directly into a knowledge base ✅ Image localization: automatically downloads all images toattachmentsdirectory, replaces them with relative paths, and allows complete offline access ✅ All-platform compatibility: automatically adapts to Windows/Linux/macOS system temporary directories ✅ Intelligent metadata extraction: automatically extracts the title, Official Account name, author, publish time, and summary ✅ Safe filenames: automatically replaces special characters, compatible with filename rules of all operating systems ✅ Category tags: supports custom article categories and automatically adds them to tags and filenames ✅ No browser dependency: lightweight HTTP requests, fast scraping speed, and low resource consumption

❓ FAQ

Q: What should I do if scraping fails with "Article body content not found"?

A: Please confirm that the article link is publicly accessible and does not have a paywall or follower-only visibility; some Official Accounts have strict anti-scraping strategies, so you can try several times.

Q: Why do some images fail to download?

A: Some images may have hotlink protection or may have expired. The script will automatically skip failed images and retain the original links, without affecting overall use.

Q: Can the output path be customized?

A: By default, it is output to the system temporary directory. If you need a custom path, you can modify the scriptarticleDirvariable configuration.

📝 Update Log

  • v1.0.1 (2026-03-18): Fixed the tag display when there is no categoryundefinedissue; when there is no category, only the "Excerpt" tag is retained, and the file name does not include a category prefix
  • v1.0.0 (2026-03-18): Initial version, completing the core scraping, Markdown conversion, image downloading, and Obsidian Front Matter generation functions