Moltbook API Client
通过API自动发布、评论和点赞Moltbook社区内容,内置反垃圾验证功能。
下载 387
通过 Felo API 提取网页内容,支持多种格式输出。
openclaw skills install @wangzhiming1999/felo-web-fetch命令、参数、文件名以原文为准
在用户希望执行以下操作时触发此技能:
触发关键词示例:
/felo-web-fetch、"使用 felo web fetch"不适用场景:
felo-search)felo-slides)Linux/macOS:
export FELO_API_KEY="your-api-key-here"Windows PowerShell:
$env:FELO_API_KEY="your-api-key-here"脚本(来自仓库):
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com/article" [options]打包 CLI(安装后执行 npm install -g felo-ai):支持相同选项,且允许简写形式:
felo web-fetch -u "https://example.com" [options]
# 简写形式:-u(url)、-f(format)、-t(timeout,单位秒)、-j(json)选项说明:
| 参数 | 默认值 | 说明 |
|---|---|---|
--url | (必填) | 要抓取的网页 URL |
--format | markdown | 输出格式:html、text、markdown |
--target-selector | - | CSS 选择器:仅抓取指定元素(如 article.main、#content) |
--wait-for-selector | - | 在抓取前等待指定选择器出现(适用于动态加载内容) |
--readability | false | 启用可读性处理(仅提取主内容) |
--crawl-mode | fast | fast 或 fine |
--timeout | 60000(脚本) / 60(CLI) | 请求超时时间:脚本使用 毫秒,CLI 使用 秒(例如 -t 90) |
--json / -j | false | 以 JSON 格式输出完整 API 响应 |
当用户希望获取页面的特定部分或特定输出格式时,请按如下方式组织命令:
--format text、--format markdown 或 --format html。#main 内的内容" / "仅抓取 article.main-content" → 使用 --target-selector "article.main" 或用户提供的选择器(如 #main、.main-content、article .post)。用户意图与对应命令示例:
| 用户意图 | 命令 |
|---|---|
| “将此页面作为纯文本获取” | --url "..." --format text |
| “仅获取主内容区域” | --url "..." --target-selector "main" 或 article |
| “将 id 为 content 的 div 以 Markdown 形式获取” | --url "..." --target-selector "#content" --format markdown |
| “仅获取文章主体部分,以 HTML 返回” | --url "..." --target-selector "article .body" --format html |
示例命令:
# 基础:以 Markdown 格式抓取
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com"
# 文章风格,启用可读性处理
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com/article" --readability --format markdown
# 原始 HTML
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com" --format html --json
# 仅抓取匹配 CSS 选择器的元素(如主文章)
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com" --target-selector "article.main" --format markdown
# 特定输出格式 + 目标选择器
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com" --target-selector "#content" --format textcurl -X POST "https://openapi.felo.ai/v2/web/extract" \
-H "Authorization: Bearer $FELO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "output_format": "markdown", "with_readability": true}'POST /v2/web/extracthttps://openapi.felo.ai。可通过 FELO_API_BASE 环境变量覆盖。Authorization: Bearer YOUR_API_KEY| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| url | string | 是 | - | 要抓取的网页 URL |
| crawl_mode | string | 否 | fast | fast 或 fine |
| output_format | string | 否 | html | html、text、markdown |
| with_readability | boolean | 否 | - | 启用可读性处理(提取主内容) |
| with_links_summary | boolean | 否 | - | 包含链接摘要 |
| with_images_summary | boolean | 否 | - | 包含图片摘要 |
| target_selector | string | 否 | - | 目标元素的 CSS 选择器 |
| wait_for_selector | string | 否 | - | 在抓取前等待该选择器出现 |
| timeout | integer | 否 | - | 超时时间(毫秒) |
| with_cache | boolean | 否 | true | 是否使用缓存 |
成功(HTTP 200):
{
"code": 0,
"message": "success",
"data": {
"content": { ... }
}
}抓取内容位于 data.content,其结构取决于 output_format。
| HTTP 状态码 | 错误码 | 描述 |
|---|---|---|
| 400 | - | 参数校验失败 |
| 401 | INVALID_API_KEY | API 密钥无效或已被撤销 |
| 500/502 | WEB_EXTRACT_FAILED | 抓取失败(服务器或页面错误) |
成功时(脚本未使用 --json):
使用 --json 时:
code、message、data。错误响应给用户的格式:
## 网页抓取失败
- 错误:`<code 或 message>`
- URL:`<请求的 URL>`
- 建议:`<例如检查 URL、重试或使用 --timeout>`FELO_API_KEY 是否存在;若缺失,返回设置说明。--timeout 参数或在请求体中设置 timeout。output_format: "markdown" 并开启 with_readability: true 以获取更清晰的文章内容。with_cache: false(脚本默认不暴露此选项)。已收录 5 个 Skill