mirror of
https://github.com/1c7/chinese-independent-developer.git
synced 2026-03-27 22:04:26 +08:00
Compare commits
34 Commits
batch-add-
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
716d754e5c | ||
|
|
699208d341 | ||
|
|
5af8e8de78 | ||
|
|
98070d9058 | ||
|
|
3f9cdacece | ||
|
|
85b130c284 | ||
|
|
edc41f5ae5 | ||
|
|
09453854c7 | ||
|
|
0eb795dcd2 | ||
|
|
b6cc5fa810 | ||
|
|
952f4e58c4 | ||
|
|
27a6726d15 | ||
|
|
f510e47feb | ||
|
|
3c84aea229 | ||
|
|
d6305984d5 | ||
|
|
23e90d602c | ||
|
|
8474f2eb69 | ||
|
|
9b3f431951 | ||
|
|
095b8c2798 | ||
|
|
e67ce1eb0b | ||
|
|
64eb5626c3 | ||
|
|
64f2d5c511 | ||
|
|
d604ce0711 | ||
|
|
de2d83a412 | ||
|
|
a06426d446 | ||
|
|
f5cec1ea05 | ||
|
|
71d4574dc7 | ||
|
|
a3a7699ab4 | ||
|
|
d4c2c4f9d5 | ||
|
|
2c7fa289e3 | ||
|
|
3ca3cd43c2 | ||
|
|
57b3d25c0f | ||
|
|
ff2918ce56 | ||
|
|
0929d713ec |
166
.github/scripts/process_item.py
vendored
166
.github/scripts/process_item.py
vendored
@@ -1,3 +1,4 @@
|
||||
# 自动扫描 GitHub Issues 中被标记为 🚀 的项目提交,通过 AI 格式化后批量添加到 README 并创建 Pull Request。
|
||||
import os
|
||||
import re
|
||||
import datetime
|
||||
@@ -79,62 +80,92 @@ def get_ai_project_line(raw_text):
|
||||
)
|
||||
return response.choices[0].message.content.strip()
|
||||
|
||||
def check_reactions(item):
|
||||
"""检查对象(Issue 或 IssueComment)是否有触发表情且没有成功标记"""
|
||||
reactions = item.get_reactions()
|
||||
has_trigger = any(r.content == TRIGGER_EMOJI and r.user.login == ADMIN_HANDLE for r in reactions)
|
||||
has_success = any(r.content == SUCCESS_EMOJI for r in reactions)
|
||||
return has_trigger, has_success
|
||||
|
||||
def main():
|
||||
# 检查环境变量
|
||||
check_environment()
|
||||
|
||||
g = Github(PAT_TOKEN)
|
||||
repo = g.get_repo(REPO_NAME)
|
||||
issue = repo.get_issue(ISSUE_NUMBER)
|
||||
|
||||
# ===== 阶段 1:收集待处理项 (Issue 160 评论 + 其他 Open Issue) =====
|
||||
pending_items = [] # 存储 (item_object, parent_issue_object)
|
||||
|
||||
# 1.1 处理 Issue 160 的评论 (Legacy)
|
||||
issue160 = repo.get_issue(ISSUE_NUMBER)
|
||||
time_threshold = datetime.now(timezone.utc) - timedelta(days=3)
|
||||
comments = issue.get_comments(since=time_threshold)
|
||||
comments160 = issue160.get_comments(since=time_threshold)
|
||||
for comment in comments160:
|
||||
has_t, has_s = check_reactions(comment)
|
||||
if has_t and not has_s:
|
||||
pending_items.append((comment, issue160))
|
||||
|
||||
# ===== 阶段 1:收集待处理评论 =====
|
||||
pending_comments = []
|
||||
formatted_entries = []
|
||||
# 1.2 扫描所有其他 Open Issue
|
||||
open_issues = repo.get_issues(state='open')
|
||||
comment_time_threshold = datetime.now(timezone.utc) - timedelta(days=7)
|
||||
|
||||
for issue in open_issues:
|
||||
if issue.number == ISSUE_NUMBER:
|
||||
continue
|
||||
|
||||
# 1. 检查 Issue Body
|
||||
has_t, has_s = check_reactions(issue)
|
||||
if has_t and not has_s:
|
||||
pending_items.append((issue, issue))
|
||||
|
||||
# 2. 检查最近 7 天的所有评论
|
||||
comments = issue.get_comments(since=comment_time_threshold)
|
||||
for comment in comments:
|
||||
has_t, has_s = check_reactions(comment)
|
||||
if has_t and not has_s:
|
||||
pending_items.append((comment, issue))
|
||||
|
||||
for comment in comments:
|
||||
reactions = comment.get_reactions()
|
||||
has_trigger = any(r.content == TRIGGER_EMOJI and r.user.login == ADMIN_HANDLE for r in reactions)
|
||||
has_success = any(r.content == SUCCESS_EMOJI for r in reactions)
|
||||
|
||||
if has_trigger and not has_success:
|
||||
print(f"\n{'='*60}")
|
||||
print(f"处理评论:\n{comment.body}")
|
||||
print(f"\n评论链接:{comment.html_url}")
|
||||
print(f"{'='*60}\n")
|
||||
|
||||
cleaned_body = remove_quote_blocks(comment.body)
|
||||
|
||||
# 判断用户是否自带了 Header
|
||||
header_match = re.search(r'^####\s+.*', cleaned_body, re.MULTILINE)
|
||||
|
||||
if header_match:
|
||||
header_line = header_match.group(0).strip()
|
||||
body_for_ai = cleaned_body.replace(header_line, "").strip()
|
||||
print(f"检测到用户自带 Header: {header_line}")
|
||||
else:
|
||||
author_name = comment.user.login
|
||||
author_url = comment.user.html_url
|
||||
header_line = f"#### {author_name} - [Github]({author_url})"
|
||||
body_for_ai = cleaned_body
|
||||
print(f"自动生成 Header: {header_line}")
|
||||
|
||||
# AI 处理项目详情行
|
||||
project_line = get_ai_project_line(body_for_ai)
|
||||
formatted_entry = f"{header_line}\n{project_line}"
|
||||
|
||||
pending_comments.append(comment)
|
||||
formatted_entries.append(formatted_entry)
|
||||
|
||||
# ===== 阶段 2:批量提交 =====
|
||||
if not pending_comments:
|
||||
print("无待处理评论")
|
||||
if not pending_items:
|
||||
print("无待处理项")
|
||||
return
|
||||
|
||||
print(f"\n共收集 {len(pending_comments)} 个待处理评论")
|
||||
print(f"\n共收集 {len(pending_items)} 个待处理项")
|
||||
|
||||
# ===== 阶段 2:格式化和 AI 处理 =====
|
||||
formatted_entries = []
|
||||
processed_items = [] # 用于最后标记和回复
|
||||
|
||||
for obj, parent in pending_items:
|
||||
print(f"\n{'='*60}")
|
||||
print(f"处理项目:来自 {parent.html_url}")
|
||||
print(f"内容:\n{obj.body[:200]}...")
|
||||
print(f"{'='*60}\n")
|
||||
|
||||
cleaned_body = remove_quote_blocks(obj.body)
|
||||
|
||||
# 判断用户是否自带了 Header
|
||||
header_match = re.search(r'^####\s+.*', cleaned_body, re.MULTILINE)
|
||||
|
||||
if header_match:
|
||||
header_line = header_match.group(0).strip()
|
||||
body_for_ai = cleaned_body.replace(header_line, "").strip()
|
||||
print(f"检测到用户自带 Header: {header_line}")
|
||||
else:
|
||||
author_name = obj.user.login
|
||||
author_url = obj.user.html_url
|
||||
header_line = f"#### {author_name} - [Github]({author_url})"
|
||||
body_for_ai = cleaned_body
|
||||
print(f"自动生成 Header: {header_line}")
|
||||
|
||||
# AI 处理项目详情行
|
||||
project_line = get_ai_project_line(body_for_ai)
|
||||
formatted_entry = f"{header_line}\n{project_line}"
|
||||
|
||||
formatted_entries.append(formatted_entry)
|
||||
processed_items.append((obj, parent, formatted_entry))
|
||||
|
||||
# ===== 阶段 3:批量提交 =====
|
||||
# 更新 README
|
||||
content = repo.get_contents("README.md", ref="master")
|
||||
readme_text = content.decoded_content.decode("utf-8")
|
||||
@@ -149,8 +180,8 @@ def main():
|
||||
|
||||
# 插入所有条目(用两个换行分隔)
|
||||
insertion_point = new_readme.find(date_header) + len(date_header)
|
||||
all_entries = "\n\n".join(formatted_entries)
|
||||
final_readme = new_readme[:insertion_point] + "\n\n" + all_entries + new_readme[insertion_point:]
|
||||
all_entries_str = "\n\n".join(formatted_entries)
|
||||
final_readme = new_readme[:insertion_point] + "\n\n" + all_entries_str + new_readme[insertion_point:]
|
||||
|
||||
# 创建分支
|
||||
branch_name = f"batch-add-projects-{datetime.now().strftime('%Y%m%d-%H%M%S')}"
|
||||
@@ -164,27 +195,27 @@ def main():
|
||||
repo.create_git_ref(ref=f"refs/heads/{branch_name}", sha=base.commit.sha)
|
||||
repo.update_file(
|
||||
"README.md",
|
||||
f"docs: batch add {len(pending_comments)} projects",
|
||||
f"docs: batch add {len(processed_items)} projects",
|
||||
final_readme,
|
||||
content.sha,
|
||||
branch=branch_name
|
||||
)
|
||||
|
||||
# 构建 PR body
|
||||
comment_links = "\n".join([
|
||||
f"- [{c.user.login}]({c.html_url})"
|
||||
for c in pending_comments
|
||||
item_links = "\n".join([
|
||||
f"- [{obj.user.login}]({obj.html_url})"
|
||||
for obj, parent, entry in processed_items
|
||||
])
|
||||
|
||||
formatted_list = "\n\n".join([
|
||||
f"### {i+1}. {formatted_entries[i]}"
|
||||
for i in range(len(formatted_entries))
|
||||
f"### {i+1}. {entry}"
|
||||
for i, (obj, parent, entry) in enumerate(processed_items)
|
||||
])
|
||||
|
||||
pr_body = f"""批量添加 {len(pending_comments)} 个项目
|
||||
pr_body = f"""批量添加 {len(processed_items)} 个项目
|
||||
|
||||
## 原始评论链接
|
||||
{comment_links}
|
||||
## 原始链接
|
||||
{item_links}
|
||||
|
||||
## 格式化结果
|
||||
{formatted_list}
|
||||
@@ -194,7 +225,7 @@ def main():
|
||||
"""
|
||||
|
||||
pr = repo.create_pull(
|
||||
title=f"新增项目:批量添加 {len(pending_comments)} 个项目",
|
||||
title=f"新增项目:批量添加 {len(processed_items)} 个项目",
|
||||
body=pr_body,
|
||||
head=branch_name,
|
||||
base="master"
|
||||
@@ -202,16 +233,25 @@ def main():
|
||||
|
||||
print(f"\n✅ PR 创建成功:{pr.html_url}")
|
||||
|
||||
# 标记所有评论(添加 🎉 表情)
|
||||
for comment in pending_comments:
|
||||
comment.create_reaction(SUCCESS_EMOJI)
|
||||
# ===== 阶段 4:标记成功并回复 =====
|
||||
replies = {} # parent_issue -> set of users
|
||||
|
||||
# 创建一条评论提及所有用户
|
||||
user_mentions = " ".join([f"@{c.user.login}" for c in pending_comments])
|
||||
reply_body = f"{user_mentions} 感谢提交,已添加!\n\n PR 链接:{pr.html_url}"
|
||||
issue.create_comment(reply_body)
|
||||
for obj, parent, entry in processed_items:
|
||||
# 标记所有条目(添加 🎉 表情)
|
||||
obj.create_reaction(SUCCESS_EMOJI)
|
||||
|
||||
# 收集需要回复的 Issue 和用户
|
||||
if parent not in replies:
|
||||
replies[parent] = set()
|
||||
replies[parent].add(obj.user.login)
|
||||
|
||||
print(f"\n✅ 已标记所有 {len(pending_comments)} 个评论")
|
||||
# 分别在各 Issue 回复
|
||||
for parent, users in replies.items():
|
||||
user_mentions = " ".join([f"@{u}" for u in users])
|
||||
reply_body = f"{user_mentions} 感谢提交,已添加!\n\n PR 链接:{pr.html_url}"
|
||||
parent.create_comment(reply_body)
|
||||
|
||||
print(f"\n✅ 已在 {len(replies)} 个 Issue 中标记并回复")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -16,6 +16,16 @@ Issue 和 PR 里偶尔有人提交一些不错的东西,但打开一看,不
|
||||
程序员版开始于 2019 年 4 月 11 号, 主版面开始于 2018 年 3 月
|
||||
-->
|
||||
|
||||
### 2026 年 3 月 25 号添加
|
||||
|
||||
#### Moresl - [Github](https://github.com/Moresl)
|
||||
* :white_check_mark: [CCHub](https://github.com/Moresl/cchub):Claude Code 生态管理平台,支持 MCP 服务器管理、Skill 技能管理、多配置切换、自定义 Slash Command 等功能,基于 Tauri v2 构建的桌面应用
|
||||
|
||||
### 2026 年 3 月 21 号添加
|
||||
|
||||
#### raullenchai - [Github](https://github.com/raullenchai)
|
||||
* :white_check_mark: [Rapid-MLX](https://github.com/raullenchai/Rapid-MLX):Apple Silicon 上最快的本地 AI 推理引擎,OpenAI API 兼容,比 Ollama 快 2-4 倍,支持 17 种工具调用解析器、推理分离、视觉模型和语音功能
|
||||
|
||||
### 2026 年 3 月 10 号添加
|
||||
|
||||
#### my19940202(上海) - [Github](https://github.com/my19940202)
|
||||
|
||||
60
README.md
60
README.md
@@ -20,6 +20,66 @@
|
||||
|
||||
## 3. 项目列表
|
||||
|
||||
### 2026 年 3 月 27 号添加
|
||||
|
||||
#### 刀刀- [Github](https://github.com/sfss5362)
|
||||
* :white_check_mark: [iSnapture](https://apps.apple.com/app/isnapture/id6760424418):macOS 截图与标注工具,支持长截图、录屏、马赛克等标注
|
||||
|
||||
#### jsxyzb - [Github](https://github.com/jsxyzb)
|
||||
* :white_check_mark: [VideoFlux](https://videoflux.video): AI 视频生成平台,支持文本生成视频、图片生成视频及多种创作模式,适用于营销视频、社媒内容、产品演示和创意短片制作,帮助用户快速产出高质量视频内容
|
||||
|
||||
#### Xavier Zhou - [Github](https://github.com/AsaZhou923)
|
||||
* :white_check_mark: [PicSpeak](https://www.picspeak.art):基于 AI 的摄影点评 Web 应用,上传一张照片,几秒钟内即可获得对构图、光线与色彩的专业分析,同时可以向社区展示你的优秀作品。
|
||||
|
||||
### 2026 年 3 月 25 号添加
|
||||
|
||||
#### DieselNiu - [Github](https://github.com/DieselNiu)
|
||||
* :white_check_mark: [Movart.ai](https://movart.ai/):AI 驱动的视频生成与动态艺术创作平台。支持将静态图片、文本提示转化为高质量动态视频。内置多种艺术风格模板,提供运动控制和帧级调整功能。在浏览器内完成视觉叙事,适用于社交媒体营销、动画制作及个人艺术创作
|
||||
|
||||
#### iaminyu - [Github](https://github.com/iaminyu)
|
||||
* :white_check_mark: [LiveTalk Translate](https://livetalktranslate.com/):针对面对面交流场景的语音翻译工具,提供比 Google Translate 更准确、交互更方便的语音翻译体验,支持深度交流
|
||||
* :white_check_mark: [MatchMyType](https://matchmytype.org/):基于 MBTI 理论,提供不同人格类型的人在恋爱、职场、交友中相处的分析和建议,并提供免费的MBTI分析报表
|
||||
|
||||
#### yvonuk - [推特](https://x.com/mcwangcn)
|
||||
* :white_check_mark: [ChatBYOK.com](https://chatbyok.com):提供原生 ChatGPT 体验的 Telegram 机器人,支持多模态输入(文字/图片/文件)、实时搜索、生图/修图、PDF 输出
|
||||
|
||||
#### Moresl - [Github](https://github.com/Moresl)
|
||||
* :white_check_mark: [CCHub](https://github.com/Moresl/cchub):Claude Code 生态管理平台,支持 MCP 服务器管理、Skill 技能管理、多配置切换、自定义 Slash Command 等功能,基于 Tauri v2 构建的桌面应用
|
||||
|
||||
#### 超能刚哥 - [Github](https://github.com/margox)
|
||||
* :white_check_mark: [订阅宝](https://apps.apple.com/cn/app/id6759794831):iOS纯原生风格且功能完备的一站式订阅服务管理应用,提供数据分析、到期/续期提醒、桌面小组件等实用功能。
|
||||
* :white_check_mark: [重要日子](https://apps.apple.com/cn/app/id6759002825):极简舒适风格的倒数日管理App,仅包含管理重要日期的核心功能,没有其他乱七八糟的功能。
|
||||
|
||||
#### coderstartup - [Github](https://github.com/coderstartup)
|
||||
* :white_check_mark: [ReelsMakerAI](https://reelsmakerai.com/):AI驱动的短视频自动生成工具,支持创建TikTok、Instagram Reels和YouTube Shorts的无人出镜视频,提供多语言AI语音、自动编辑和高清无水印导出
|
||||
|
||||
### 2026 年 3 月 24 号添加
|
||||
|
||||
#### Chaoc2624 - [Github](https://github.com/Chaoc2624)
|
||||
* :white_check_mark: [playcharades.fun](https://playcharades.fun):线上你画我猜,500+个词汇涵盖11个分类。为儿童、成人或所有年龄段生成随机词汇。8种语言免费游戏。
|
||||
|
||||
#### simple-Jian-tw - [Github](https://github.com/simple-Jian-tw)
|
||||
* :white_check_mark: [AnimeGen](https://animegen.ai/):AI 照片转动漫工具,可将肖像、自拍、宠物或旅行照片转换为多种动漫风格,快速生成可下载结果,适用于头像、社交媒体帖子和创意项目。
|
||||
|
||||
### 2026 年 3 月 23 号添加
|
||||
|
||||
#### Miracle(杭州) - [Github](https://github.com/zhoulianbo)
|
||||
* :white_check_mark: [ScriptMind](https://scriptmind.co/):提取 YouTube、TikTok、Instagram 视频文案,HD视频无水印下载
|
||||
* :white_check_mark: [漫游中国指南](https://wanderchina.guide/):中国旅游指南,探索地道的中国文化,轻松规划中国游旅程,发现一个美丽而真实的中国。
|
||||
* :white_check_mark: [ReadMenuAi](https://readmenuai.com/):中文菜单翻译器,AI生成对应菜品的图片,不懂中文也可以自信点餐!
|
||||
|
||||
#### Moresl - [Github](https://github.com/Moresl)
|
||||
* :white_check_mark: [SnapImg](https://github.com/Moresl/snapimg):图片压缩工具,支持 PNG、JPEG、WebP、AVIF 格式,70%+ 压缩率同时保持画质。支持批量压缩、前后效果滑动对比,图片全程纯内存处理,不保存到磁盘,支持 Docker 自部署。
|
||||
|
||||
#### aprilcc666 - [Github](https://github.com/aprilcc666)
|
||||
* :white_check_mark: [WhiteScreen.Space](https://whitescreen.space/):全屏白屏工具,用于检测坏点、节省 OLED 屏幕电量、测试显示器以及清洁屏幕
|
||||
|
||||
#### stark-ydq - [Github](https://github.com/stark-ydq)
|
||||
* :white_check_mark: [Voice to Instrument](https://voicetoinstrument.com?utm_source=github&utm_medium=directory&utm_campaign=backlink):AI 工具,将人声录音转换为器乐曲目。上传歌声或录音,AI 自动生成钢琴、吉他、鼓等器乐伴奏。
|
||||
|
||||
#### zx88cvb - [Github](https://github.com/zx88cvb),[博客](https://haydenbi.com/)
|
||||
* :white_check_mark: [Mydirs](https://mydirs.com):导航站收录产品和工具,吸引流量并建立高质量外部链接
|
||||
|
||||
### 2026 年 3 月 19 号添加
|
||||
|
||||
#### 小鹿(全国旅居中) - [小红书](https://xhslink.com/m/9njPzLyGqiB)
|
||||
|
||||
Reference in New Issue
Block a user