opencli-plugins
已认证
开发
v1.0.0 · 小杨
📥 下载 396 次
📦 2.6KB
📅 2026-05-25
opencli-plugins
本技能提供两个热榜查询功能,均通过 opencli browser --session default 直接操作浏览器抓取,不依赖第三方插件。
前置条件: Chrome 运行中 + OpenCLI 扩展已连接
opencli doctor # 确认全部绿色
1️⃣ GitHub Trending
查询 GitHub 当天/本周/本月的热门开源项目。
使用辅助脚本(推荐)
# 默认:Python 热门 TOP 10
pwsh tools/opencli-plugins/github-trending.ps1
# 按语言过滤
pwsh tools/opencli-plugins/github-trending.ps1 -language rust -since weekly
# 时间范围 & 数量
pwsh tools/opencli-plugins/github-trending.ps1 -language typescript -since monthly -limit 15 -format json
直接浏览器命令
# 打开 GitHub Trending 页
opencli browser --session default open "https://github.com/trending?since=daily"
# 稍等加载,然后提取数据(替换 limit 数值)
opencli browser --session default eval "(() => { return [...document.querySelectorAll('article.Box-row')].slice(0,5).map((el,i) => ({rank:i+1, name:el.querySelector('h2 a')?.getAttribute('href')?.slice(1)||'', description:el.querySelector('p')?.textContent?.trim()||'', language:el.querySelector('[itemprop=programmingLanguage]')?.textContent?.trim()||'', stars:el.querySelector('.Link--muted.d-inline-block.mr-3')?.textContent?.trim()||'0'})); })()"
| 参数 | 说明 | 默认 |
|---|---|---|
-language | 语言过滤(python, rust, typescript…) | 全部 |
-since | 时间范围:daily / weekly / monthly | daily |
-limit | 返回数量 | 10 |
-format | 输出格式:json / table | json |
2️⃣ 多平台热榜聚合 (hot-digest)
同时从多个平台抓取热榜,合并输出。
使用辅助脚本(推荐)
# 默认:知乎 + 微博 各 5 条
pwsh tools/opencli-plugins/hot-digest.ps1
# 自定义来源和数量
pwsh tools/opencli-plugins/hot-digest.ps1 -sources "zhihu,bilibili,v2ex" -limit 10 -format json
# JSON 输出(AI 最佳)
pwsh tools/opencli-plugins/hot-digest.ps1 -sources "weibo,reddit,linux-do" -limit 5 -format json
支持平台
| 来源 | 来源名 | 抓取方式 |
|---|---|---|
| 知乎热榜 | zhihu | API 直连 |
| 微博热搜 | weibo | API 直连 |
| B站热门 | bilibili | API 直连 |
| V2EX 热帖 | v2ex | API 直连 |
| Stack Overflow 热门 | stackoverflow | API 直连 |
| Reddit 热门 | reddit | API 直连 |
| Linux.do 热帖 | linux-do | API 直连 |
直接浏览器命令(单平台)
也可以直接用内置 site adapter 查单平台:
opencli zhihu hot --limit 5 -f json
opencli weibo hot --limit 5 -f json
opencli bilibili hot --limit 5 -f json
opencli v2ex hot --limit 5 -f json
典型场景
AI 今日热点
# GitHub Python 热门
pwsh tools/opencli-plugins/github-trending.ps1 -language python -limit 10 -format json
# 技术社区热榜
pwsh tools/opencli-plugins/hot-digest.ps1 -sources "zhihu,v2ex,stackoverflow" -limit 5 -format json
开发者综合资讯
pwsh tools/opencli-plugins/github-trending.ps1 -since weekly -limit 15
pwsh tools/opencli-plugins/hot-digest.ps1 -sources "weibo,bilibili,reddit" -limit 10 -format json
注意事项
- 必须浏览器连接:所有命令都通过
opencli browser --session default操作,Chrome 需运行且扩展已连接。 - 各平台 API 可能变化:如果某来源返回空,可能是该平台的 API 接口有变动。
- 脚本位置:
tools/opencli-plugins/github-trending.ps1和tools/opencli-plugins/hot-digest.ps1 - 单来源失败不影响其他:hot-digest 每个来源独立抓取,失败自动跳过。
- AI Agent 使用建议:加
-format json获取 JSON 结构,方便解析。
💡 安装方法
下载 ZIP 解压到 skills/ 目录即可使用