feat: use dynamic badges for Top 6 plugin statistics in README
This commit is contained in:
14
README.md
14
README.md
@@ -7,7 +7,7 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu
|
|||||||
|
|
||||||
<!-- STATS_START -->
|
<!-- STATS_START -->
|
||||||
## 📊 Community Stats
|
## 📊 Community Stats
|
||||||
> 🕐 Auto-updated: 2026-02-11 12:09
|
> 🕐 Auto-updated: 2026-02-11 12:10
|
||||||
|
|
||||||
| 👤 Author | 👥 Followers | ⭐ Points | 🏆 Contributions |
|
| 👤 Author | 👥 Followers | ⭐ Points | 🏆 Contributions |
|
||||||
| :---: | :---: | :---: | :---: |
|
| :---: | :---: | :---: | :---: |
|
||||||
@@ -20,12 +20,12 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu
|
|||||||
### 🔥 Top 6 Popular Plugins
|
### 🔥 Top 6 Popular Plugins
|
||||||
| Rank | Plugin | Version | Downloads | Views | Updated |
|
| Rank | Plugin | Version | Downloads | Views | Updated |
|
||||||
| :---: | :--- | :---: | :---: | :---: | :---: |
|
| :---: | :--- | :---: | :---: | :---: | :---: |
|
||||||
| 🥇 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | 0.9.2 | 954 | 8385 | 2026-01-29 |
|
| 🥇 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | 0.9.2 |  |  | 2026-01-29 |
|
||||||
| 🥈 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | 1.5.0 | 707 | 6701 | 2026-01-31 |
|
| 🥈 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | 1.5.0 |  |  | 2026-01-31 |
|
||||||
| 🥉 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | 0.4.4 | 383 | 3026 | 2026-02-07 |
|
| 🥉 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | 0.4.4 |  |  | 2026-02-07 |
|
||||||
| 4️⃣ | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | 1.2.2 | 363 | 3754 | 2026-01-29 |
|
| 4️⃣ | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | 1.2.2 |  |  | 2026-01-29 |
|
||||||
| 5️⃣ | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | 0.3.7 | 342 | 1671 | 2026-02-10 |
|
| 5️⃣ | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | 0.3.7 |  |  | 2026-02-10 |
|
||||||
| 6️⃣ | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | 1.2.4 | 341 | 4711 | 2026-01-29 |
|
| 6️⃣ | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | 1.2.4 |  |  | 2026-01-29 |
|
||||||
|
|
||||||
*See full stats and charts in [Community Stats Report](./docs/community-stats.md)*
|
*See full stats and charts in [Community Stats Report](./docs/community-stats.md)*
|
||||||
<!-- STATS_END -->
|
<!-- STATS_END -->
|
||||||
|
|||||||
14
README_CN.md
14
README_CN.md
@@ -6,7 +6,7 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词
|
|||||||
|
|
||||||
<!-- STATS_START -->
|
<!-- STATS_START -->
|
||||||
## 📊 社区统计
|
## 📊 社区统计
|
||||||
> 🕐 自动更新于 2026-02-11 12:09
|
> 🕐 自动更新于 2026-02-11 12:10
|
||||||
|
|
||||||
| 👤 作者 | 👥 粉丝 | ⭐ 积分 | 🏆 贡献 |
|
| 👤 作者 | 👥 粉丝 | ⭐ 积分 | 🏆 贡献 |
|
||||||
| :---: | :---: | :---: | :---: |
|
| :---: | :---: | :---: | :---: |
|
||||||
@@ -19,12 +19,12 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词
|
|||||||
### 🔥 热门插件 Top 6
|
### 🔥 热门插件 Top 6
|
||||||
| 排名 | 插件 | 版本 | 下载 | 浏览 | 更新日期 |
|
| 排名 | 插件 | 版本 | 下载 | 浏览 | 更新日期 |
|
||||||
| :---: | :--- | :---: | :---: | :---: | :---: |
|
| :---: | :--- | :---: | :---: | :---: | :---: |
|
||||||
| 🥇 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | 0.9.2 | 954 | 8385 | 2026-01-29 |
|
| 🥇 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | 0.9.2 |  |  | 2026-01-29 |
|
||||||
| 🥈 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | 1.5.0 | 707 | 6701 | 2026-01-31 |
|
| 🥈 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | 1.5.0 |  |  | 2026-01-31 |
|
||||||
| 🥉 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | 0.4.4 | 383 | 3026 | 2026-02-07 |
|
| 🥉 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | 0.4.4 |  |  | 2026-02-07 |
|
||||||
| 4️⃣ | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | 1.2.2 | 363 | 3754 | 2026-01-29 |
|
| 4️⃣ | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | 1.2.2 |  |  | 2026-01-29 |
|
||||||
| 5️⃣ | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | 0.3.7 | 342 | 1671 | 2026-02-10 |
|
| 5️⃣ | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | 0.3.7 |  |  | 2026-02-10 |
|
||||||
| 6️⃣ | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | 1.2.4 | 341 | 4711 | 2026-01-29 |
|
| 6️⃣ | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | 1.2.4 |  |  | 2026-01-29 |
|
||||||
|
|
||||||
*完整统计与趋势图请查看 [社区统计报告](./docs/community-stats.zh.md)*
|
*完整统计与趋势图请查看 [社区统计报告](./docs/community-stats.zh.md)*
|
||||||
<!-- STATS_END -->
|
<!-- STATS_END -->
|
||||||
|
|||||||
@@ -202,6 +202,11 @@ class OpenWebUIStats:
|
|||||||
- prev.get("points", 0),
|
- prev.get("points", 0),
|
||||||
"contributions": stats.get("user", {}).get("contributions", 0)
|
"contributions": stats.get("user", {}).get("contributions", 0)
|
||||||
- prev.get("contributions", 0),
|
- prev.get("contributions", 0),
|
||||||
|
"posts": {
|
||||||
|
p["slug"]: p["downloads"]
|
||||||
|
- prev.get("posts", {}).get(p["slug"], p["downloads"])
|
||||||
|
for p in stats.get("posts", [])
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def _resolve_post_type(self, post: dict) -> str:
|
def _resolve_post_type(self, post: dict) -> str:
|
||||||
@@ -701,6 +706,39 @@ class OpenWebUIStats:
|
|||||||
"content": json.dumps(badge_data, ensure_ascii=False)
|
"content": json.dumps(badge_data, ensure_ascii=False)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 生成 Top 6 插件徽章 (基于槽位 p1, p2...)
|
||||||
|
post_deltas = delta.get("posts", {})
|
||||||
|
for i, post in enumerate(stats.get("posts", [])[:6]):
|
||||||
|
idx = i + 1
|
||||||
|
diff = post_deltas.get(post["slug"], 0)
|
||||||
|
|
||||||
|
# 下载量徽章
|
||||||
|
dl_msg = f"{post['downloads']}"
|
||||||
|
if diff > 0:
|
||||||
|
dl_msg += f" (+{diff}🚀)"
|
||||||
|
|
||||||
|
files_payload[f"badge_p{idx}_dl.json"] = {
|
||||||
|
"content": json.dumps(
|
||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"label": "Downloads",
|
||||||
|
"message": dl_msg,
|
||||||
|
"color": "brightgreen",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
# 浏览量徽章 (由于历史记录没记单个 post 浏览量,暂时只显总数)
|
||||||
|
files_payload[f"badge_p{idx}_vw.json"] = {
|
||||||
|
"content": json.dumps(
|
||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"label": "Views",
|
||||||
|
"message": f"{post['views']}",
|
||||||
|
"color": "blue",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
# 批量上传到 Gist
|
# 批量上传到 Gist
|
||||||
url = f"https://api.github.com/gists/{self.gist_id}"
|
url = f"https://api.github.com/gists/{self.gist_id}"
|
||||||
headers = {"Authorization": f"token {self.gist_token}"}
|
headers = {"Authorization": f"token {self.gist_token}"}
|
||||||
@@ -819,9 +857,18 @@ class OpenWebUIStats:
|
|||||||
|
|
||||||
medals = ["🥇", "🥈", "🥉", "4️⃣", "5️⃣", "6️⃣"]
|
medals = ["🥇", "🥈", "🥉", "4️⃣", "5️⃣", "6️⃣"]
|
||||||
for i, post in enumerate(top_plugins):
|
for i, post in enumerate(top_plugins):
|
||||||
medal = medals[i] if i < len(medals) else str(i + 1)
|
idx = i + 1
|
||||||
|
medal = medals[i] if i < len(medals) else str(idx)
|
||||||
|
|
||||||
|
# 如果有 Gist,使用动态徽章
|
||||||
|
dl_cell = f"{post['downloads']}"
|
||||||
|
vw_cell = f"{post['views']}"
|
||||||
|
if base_badge_url:
|
||||||
|
dl_cell = f""
|
||||||
|
vw_cell = f""
|
||||||
|
|
||||||
lines.append(
|
lines.append(
|
||||||
f"| {medal} | [{post['title']}]({post['url']}) | {post['version']} | {post['downloads']} | {post['views']} | {post['updated_at']} |"
|
f"| {medal} | [{post['title']}]({post['url']}) | {post['version']} | {dl_cell} | {vw_cell} | {post['updated_at']} |"
|
||||||
)
|
)
|
||||||
|
|
||||||
lines.append("")
|
lines.append("")
|
||||||
|
|||||||
Reference in New Issue
Block a user