跳到正文
Skillpedia
网页抓取27k · #9953

baoyu-danger-x-to-markdown

它能做什么

这项技能把推文、串推和 X 文章转换为可读的 Markdown 文件。适合希望保存或归档 X 上帖子的人。

适用场景

  • ✓当你想把一条推文或串推保存为 Markdown 文件的时候。
  • ✓当你有一篇想保留为可读文字的 X 文章的时候。
  • ✓当你有一个想转换的 x.com 或 twitter.com 链接的时候。

技能链接

https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把这条推文串保存为 Markdown 文件,并在头部写上日期和作者。”

每周 5 个新技能,1 分钟读完。

工作原理

你的智能体检查你是否已接受同意条款,通过逆向工程得到的连接获取帖子,并将其写入带有头部信息的 Markdown 文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

X to Markdown

Tweets/threads → markdown with YAML front matter; X Articles → full content.

User Input Tools

When this skill prompts the user, follow this tool-selection rule (priority order):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.

Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.

Script Directory

  1. {baseDir} = this SKILL.md's directory; script = {baseDir}/scripts/main.ts
  2. ${BUN_X} = bun if installed; else npx -y bun if npx available; else suggest installing bun

Consent Requirement (before any conversion)

  1. Read the consent file:
    • macOS: ~/Library/Application\ Support/baoyu-skills/x-to-markdown/consent.json
    • Linux: ~/.local/share/baoyu-skills/x-to-markdown/consent.json
  2. accepted: true and disclaimerVersion: "1.0" → print Warning: Using reverse-engineered X API. Accepted on: <acceptedAt> and proceed.
  3. Missing or version mismatch → show this disclaimer and ask "Yes, I accept" | "No, I decline":
    DISCLAIMER
    
    This tool uses a reverse-engineered X API, NOT official.
    
    Risks:
    - May break if X changes API
    - No guarantees or support
    - Possible account restrictions
    - Use at your own risk
    
    Accept terms and continue?
    
  4. Accept → write the consent file:
    {
      "version": 1,
      "accepted": true,
      "acceptedAt": "<ISO timestamp>",
      "disclaimerVersion": "1.0"
    }
    
  5. Decline → output "User declined. Exiting." and stop.

Preferences (EXTEND.md)

First one found wins:

Priority Path Scope
1 .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md Project
2 ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md XDG
3 $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md User home

Found → read and apply. Not found → BLOCKING first-time setup: ask the questions in references/config/first-time-setup.md (Media, Output, Save — all in one call) before any conversion, write EXTEND.md at the chosen location, confirm "Preferences saved to [path]", then continue. Never create EXTEND.md with defaults without asking.

Key Default Values
download_media ask ask (prompt each time) / 1 (always) / 0 (never)
default_output_dir empty (= ./x-to-markdown/) path or empty

Value priority: CLI arguments (--download-media, -o) → EXTEND.md → skill defaults.

Usage

${BUN_X} {baseDir}/scripts/main.ts <url>
${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md
${BUN_X} {baseDir}/scripts/main.ts <url> --download-media
${BUN_X} {baseDir}/scripts/main.ts <url> --json
Option Description
<url> Tweet or article URL
-o <path> Output path
--json JSON output
--download-media Download images/videos to local imgs/ and videos/ next to the markdown, rewrite links to local relative paths
--login Refresh cookies only

Supported URLs: https://x.com/<user>/status/<id>, https://twitter.com/<user>/status/<id>, https://x.com/i/article/<id>

Output

---
url: "https://x.com/user/status/123"
author: "Name (@user)"
tweetCount: 3
coverImage: "https://pbs.twimg.com/media/example.jpg"
---

Content...

File structure: x-to-markdown/{username}/{tweet-id}/{content-slug}.md

Media Download

By EXTEND.md download_media: 1 → run with --download-media; 0 → run without; ask (default):

  1. Run without --download-media → markdown saved
  2. Check it for remote media (https:// image/video links); none → done, no prompt
  3. Otherwise ask (header "Media", question "Download N images/videos to local files?"): "Yes" — download to local directories / "No" — keep remote URLs
  4. Yes → rerun with --download-media (overwrites markdown with localized links)

Authentication

  1. Environment variables (preferred): `X_AUTH_TOKE
常见问题

为什么需要同意?

该技能使用逆向工程得到的 X 连接,因此首次使用时会要求你接受其条款。

文件包含什么?

文件顶部包含 YAML 前置元数据,记录帖子的详细信息,随后是帖子内容。

它会保存完整的 X 文章吗?

会。该技能会把 X 文章转换为完整内容,推文和串推也同样支持。

详情

作者的原始描述

Converts X (Twitter) tweets and articles to markdown with YAML front matter. Uses reverse-engineered API requiring user consent. Use when user mentions "X to markdown", "tweet to markdown", "save tweet", or provides x.com/twitter.com URLs for conversion.

repo: JimLiu/baoyu-skills

热度

GitHub 星标
27k
排名
#9953
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能