/iasiv5-skills:x-article-archivefrom iasiv5-skills
把 X/Twitter 文章、推文长文或网页文章存成原汁原味的离线档案——正文逐字照录、配图与元数据全部本地化、Markdown + 单文件 HTML 快照 + 原始 JSON 三层存档。用户给出文章链接要求保存、存档、离线阅读,或要把快照拿到手机查看、传阅时使用。
Ships in iasiv5-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
你做网页内容的原汁原味离线存档。目标:正文逐字、配图齐全、元数据可信、单文件可携。读这份存档的人应该在任何年后、离线状态下,仍获得与线上几乎一致的阅读体验。
x.com/<user>/status/<id> 或普通网页 URL)。用 r.jina.ai 渲染代理:免费无 key、执行 JS、能过 X 登录墙,markdown 输出自带全部内嵌图 URL。纪律是落盘再过滤:先写进 /tmp 文件,本地 grep 取所需,摘要类抓取通道只配拿正文初稿:
curl -s --max-time 90 "https://r.jina.ai/<URL>" -o /tmp/article-jina.md
# 提取文中配图 URL(保出现顺序、去重)
grep -oE 'https://pbs\.twimg\.com/media/[^) "]+\.(jpg|png|webp)[^) "]*' /tmp/article-jina.md | awk '!seen[$0]++'
# 提图在正文中的位置:按行号看前后文
grep -n 'pbs.twimg.com/media' /tmp/article-jina.md
X 长文(X Articles)要用 status 分享页 URL 交给代理;/i/article/<id> 直链有登录墙。分享推文本身就是长文的卡片,正文会随页面渲染出来。
syndication API 的 tweet-result 端点给出标题、封面、作者、互动数与 article 实体,无需登录。token 是公开算法 ((Number(id)/1e15)*2**27).toString(36):
token=$(python3 -c "
n = int(float(int('$ID')) / 1e15 * 2**27)
d = '0123456789abcdefghijklmnopqrstuvwxyz'
s = ''
while n: s = d[n % 36] + s; n //= 36
print(s or '0')")
curl -s "https://cdn.syndication.twimg.com/tweet-result?id=${ID}&token=${token}&lang=en" -o raw-tweet-result.json
这份 JSON 原样入档——它是最原汁原味的一层(article 实体含 title、cover_media、preview_text、rest_id)。普通网页跳过本步,元数据从页面 header 提取。
pbs.twimg.com 是公开 CDN,无需登录,?name=large 取高清原图;按文中出现顺序命名 fig-1.jpg 起步,封面命名 cover.jpg,作者头像放共享 assets/avatars/。下载后用 file 核验是有效 JPEG/PNG 而非错误页。
每篇文章一个目录:
| 文件 | 职责 |
|---|---|
article.md | 精读主档:元数据表(官方标题/作者/时间/互动数/Article ID)+ 正文逐字 + 文中插图()+ 配图清单(每张源 URL + 嵌入位置) |
snapshot.html | 阅读快照:仿原文排版的阅读版,本地图片,互链各篇,含打印样式 |
raw-tweet-result.json | 官方 API 原始响应,永不加工 |
images/ | cover + fig-N |
多篇相关文章共置一个根目录,README.md 做总索引:关系说明、阅读顺序建议、完整性声明汇总、抓取通道复现记录。
把 snapshot.html 里所有本地图片引用替换为 base64 data URI,做成零外链的真单文件(约每篇 3MB):
import base64, pathlib, re
html = pathlib.Path(p); raw = html.read_text(encoding="utf-8")
def sub(m):
img = (html.parent / m.group(1)).resolve()
return 'src="data:image/jpeg;base64,' + base64.b64encode(img.read_bytes()).decode() + '"'
out = re.sub(r'src="((?:\.\./|images/)[^"]+\.(?:jpg|png))"', sub, raw)
替换数量要有断言(每篇 = 封面 + 头像 + 内嵌图数),防静默漏嵌。
count==1),失败即停,不做静默部分修改。pbs.twimg.com/media/<id> 不带 ?name= 时给的是小图;name=large 才是高清档。What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub iasiv5/skills --plugin iasiv5-skills34 skills in this plugin
/answer-me-with-htmlTurns an answer into a one-page visual HTML explainer: the model writes a short Markdown draft and the bundled CLI builds one page. Use it proactively and liberally in replies to the user, without being asked, whenever a page would help the reader more than plain text, even if plain text would also work: any explanation of how something works or how parts relate (flow, request path, architecture, code or folder structure, state machine, lifecycle, history); any comparison, trade-off or decision with pros and cons; any diagnosis, review or investigation, especially with several causes or findings to rank; any answer with a table, a numbered or ranked list, steps, branches or several sections; or when the user says "I don't get it / draw it / explain visually / 讲讲原理 / 没看懂 / 画个图". When in doubt, use it: a page is quick and cheap to make. Also for explainer videos ("make a video", "做个视频") and for changing its settings. Skip only for small talk, a trivial one-line answer, or when the user asks for plain text./architecture-diagramCreate polished dark-themed architecture diagrams as self-contained HTML+SVG files. Use when the user asks for system, infrastructure, cloud, security, or network topology diagrams.