新闻搜索、内容工具和社交媒体 API 的命令行工具。
npm install -g gnomic-cli- Node.js >= 14.0.0
gnomic <命令> [子命令] [选项]搜索和获取热门新闻。
# 按关键词搜索新闻
gnomic news search "你的关键词"
# 获取热门新闻
gnomic news hot
# 以文本格式输出(默认 JSON)
gnomic news search "AI" -f text
gnomic news hot -f text将 HTML 转换为可访问的 URL。
# 将 HTML 字符串转换为 URL
gnomic content html2url "<html>...</html>"
# 从文件读取 HTML 并转换
gnomic content html2url -i ./path/to/file.html
# 以文本格式输出
gnomic content html2url "<html>...</html>" -f text获取抖音和小红书的数据。
# 获取抖音视频数据
gnomic social dy-video <视频链接>
# 读取小红书笔记
gnomic social xhs-note <笔记链接>
# 以文本格式输出
gnomic social dy-video <视频链接> -f text| 选项 | 说明 | 默认值 |
|---|---|---|
-f, --format <type> |
输出格式(json 或 text) | json |
-i, --file <path> |
从文件路径读取 HTML | - |
-V, --version |
显示版本号 | - |
-h, --help |
显示帮助信息 | - |
在项目根目录创建 .env 文件来配置 API 设置:
API_BASE_URL=你的API地址ISC