4.4 KiB
| name | description |
|---|---|
| clip-web-article | Use when the user wants to download or clip a single web article URL into lightweight local Markdown with local sibling images, especially requests like "下载文章 URL" for Zhihu answers/articles/pins, WeChat public account articles, X/Twitter posts or threads, and ordinary web articles. Uses OpenCLI browser/login state and never asks the user to paste cookies. |
Clip Web Article
Save one or more user-provided article URLs as discussion material. Each URL becomes one folder containing one Markdown file plus local image files.
Default Output
Save to:
C:\Users\wangq\Documents\Codex\knowledge-vault\sources\clipped-articles\文章参考
The default final shape is short enough for repeated daily use:
YYYYMMDD-短标题/
短标题.md
img_1.jpg
img_2.png
Do not add platform folders, metadata JSON, logs, raw HTML, screenshots, YAML frontmatter, or original URL lines by default.
Callers may override the destination:
conda run --no-capture-output -n skills-vault python -B .\scripts\clip_web_article.py "URL" --output-root "D:\target\folder"
Procedure
- Confirm the input is one or more article-like URLs.
- Run the bundled script from this Skill directory:
conda run --no-capture-output -n skills-vault python -B .\scripts\clip_web_article.py "URL"
- For batch clipping, pass multiple URLs in one call:
conda run --no-capture-output -n skills-vault python -B .\scripts\clip_web_article.py "URL1" "URL2" "URL3"
- If running from another working directory, use the absolute script path:
conda run --no-capture-output -n skills-vault python -B "C:\Users\wangq\.agents\skills\clip-web-article\scripts\clip_web_article.py" "URL"
- If the script reports
Language: English, keep the generated English Markdown as the original and create a sibling Chinese translation Markdown in the same folder. Preserve image links and code blocks. Do not replace the English original. - Report only the saved folder, Markdown file name(s), image count, and any short failure/partial-success note.
Routing
The script uses OpenCLI as the browser and extraction substrate:
mp.weixin.qq.com:opencli weixin download, then flatten output.zhuanlan.zhihu.com:opencli zhihu download, then flatten output.www.zhihu.com/question/.../answer/...:opencli zhihu answer-detail <answer-id>, so only the target answer is saved.www.zhihu.com/pin/...:opencli web read, then remove Zhihu page chrome, author cards, edit/comment UI, and keep the pin body plus body images.x.com/twitter.com:opencli twitter thread, then save only the target status row and localize its media.- Other URLs:
opencli web read, then flatten output.
All OpenCLI browser-backed commands pass --keep-tab false so the tab lease opened for clipping is released after the command. Do not close the user's Chrome process.
Boundaries
- Use the user's connected OpenCLI Browser Bridge / logged-in browser state when needed.
- Do not read or save raw cookies, localStorage, passwords, session stores, or tokens.
- Do not ask the user to paste cookies.
- Do not bypass CAPTCHA, verification gates, paywalls, DRM, anti-bot restrictions, or login walls.
- Do not perform side-effect actions such as posting, liking, following, commenting, collecting, or sending messages.
- Do not batch crawl feeds or accounts.
- Save only the original article/post/answer body. Do not include comments, reply threads, other Zhihu answers, recommendation cards, profile cards, or page operation UI.
- For discussion-like URLs, treat the URL target as the boundary: a Zhihu answer URL means that answer only; an X status URL means that status only.
- If OpenCLI reports auth, verification, bridge, timeout, or blocked access, stop and ask the user to open the page in a connected browser or provide the content manually.
Translation
For any English article/post from any source, preserve the English original Markdown and create a separate Chinese translation Markdown in the same folder. Do not append the translation into the original file and do not overwrite the original.
Validation
For source changes, run:
conda run -n skills-vault python -B -m unittest discover -s skills\clip-web-article\tests -v
conda run -n skills-vault python -B scripts\quick_validate.py skills\clip-web-article