Skip to content
Back to skills

Github Trending Stable

ASecurity

通过网页抓取获取 GitHub 按日/周/月增长的热门仓库。当用户询问 GitHub 趋势、热门项目、本周热点或「什么在 GitHub 上 trending」时使用。可输出列表或 JSON,无需 API Key。

  • 33 stars
  • 0 votes
  • 0 copies
  • 15 views
  • Added September 5, 2026
developmentjavascripttypescriptpythonrustgojavarubyc++c#bash

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill github-trending-stable --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Trending Stable?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github Trending Stable
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-github-trending-stable/badge)](https://www.skillsdirectory.com/skills/dvcrn-github-trending-stable)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-trending-stable
description: "通过网页抓取获取 GitHub 按日/周/月增长的热门仓库。当用户询问 GitHub 趋势、热门项目、本周热点或「什么在 GitHub 上 trending」时使用。可输出列表或 JSON,无需 API Key。"
---

# GitHub Trending

抓取 GitHub 按日/周/月增长的热门仓库,仅使用 Python 标准库,无需安装第三方包。

## 何时使用

- 用户询问 **GitHub 趋势**、**热门项目**、**本周热点**
- 用户需要 **今日** / **本周** / **本月** 趋势
- 用户需要按 **编程语言** 筛选的 trending

## 快速开始

在技能目录下执行(如 `github-trending-stable/`):

```bash
# 本周趋势(默认),15 条
python scripts/github_trending.py weekly

# 今日趋势,10 条
python scripts/github_trending.py daily --limit 10

# 本周 Python 趋势
python scripts/github_trending.py weekly --language python

# 输出 JSON(便于管道或工具调用)
python scripts/github_trending.py weekly --json
```

## 参数说明

| 参数 | 取值 | 默认 | 说明 |
|------|------|------|------|
| `period` | `daily`, `weekly`, `monthly` | `weekly` | 统计「新增 star」的时间范围 |
| `--limit` | 整数 | 15 | 返回仓库数量上限 |
| `--language` | 字符串 | 全部 | 按语言筛选(见下方) |
| `--json` | 开关 | — | 输出 JSON 而非可读文本 |

**语言**:可用全称或别名。脚本支持别名:`py`→python、`ts`→typescript、`js`→javascript、`cpp`/`c++`→c++、`c#`/`csharp`→c#、`rs`→rust、`rb`→ruby、`go`→go。其他按原样传入(如 `--language "c"`)。

## 输出格式

### 文本(默认)

- 排名、仓库 `full_name`、描述(最多 90 字)
- 每行统计符号含义:
  - **🔧** 编程语言
  - **⭐** 总 Star 数
  - **📈** 本周期新增 Star 数
- 时间为北京时区 (UTC+8)

### JSON(`--json`)

```json
{
  "period": "weekly",
  "updated_at": "2026-03-13T21:00:00+08:00",
  "data": [
    {
      "rank": 1,
      "full_name": "owner/repo",
      "url": "https://github.com/owner/repo",
      "description": "...",
      "language": "Python",
      "stars_total": "12345",
      "stars_gained": 1234
    }
  ]
}
```

## 数据来源

- **地址**:`https://github.com/trending`(及 `.../trending/<语言>?since=<周期>`)
- **方式**:HTTP + `html.parser.HTMLParser`(无需浏览器、无需登录)
- **实时**:每次执行都会拉取当前页面

## 依赖

仅使用 Python 标准库:`urllib.request`、`html.parser`、`json`、`argparse`、`datetime`。**无需 pip 安装。**

## 常见问题

| 现象 | 处理建议 |
|------|----------|
| 返回空列表 / 无仓库 | 可能是网络提前断开(IncompleteRead)。重试;若脚本支持,可改用分块读取。 |
| 解析报错 / 结构不对 | GitHub 可能改版了页面结构,需更新脚本选择器或解析逻辑。 |
| 超时 | 检查网络;默认超时 15 秒。 |
| Windows 控制台 emoji 乱码/报错 | 设置 `PYTHONIOENCODING=utf-8` 或使用 `--json` 在别处解析。 |

## 说明

- 趋势按**选定周期内新增的 star** 排序,不是按总 star 数。
- 若需 GitHub API(如按 star 搜索、鉴权等),请使用单独的 GitHub API 类技能。

Files in this skill

  • SKILL.md3.2 KB
  • scripts/github_trending.py6.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.