添加了对github-release情况的监测

This commit is contained in:
MasonLiu committed 2025-01-02 16:03:25 +08:00
1 parent 91d273810d
commit e594ca1711
4 files changed
+109 -20

No files matched your search

+36 -3
View File
@@ -82,7 +82,7 @@ def github_main_keyword(key):
}
# print(project_info)
all_results.append(project_info)
time.sleep(10)
time.sleep(5)
# 将所有结果写入JSON文件
save_to_json(all_results, './JSON/github_keyword.json')
@@ -125,11 +125,43 @@ def github_main_repo(key):
}
# print(project_info)
all_results.append(project_info)
time.sleep(10)
time.sleep(5)
# 将所有结果写入JSON文件
save_to_json(all_results, './JSON/github_repo.json')
def github_main_release(key):
all_results = [] # 用于存储所有结果
for keyword in key:
logger.info(f"github_repo:项目【{keyword}】发版情况获取开始。")
api_node = "https://api.github.com/repos/{}/releases?per_page=1".format(keyword)
result = fetch_rss(api_node)
if not result:
logger.warning(f"github_repo:项目【{keyword}】不存在版本发布情况。")
time.sleep(5)
continue
# print(result)
# print(keyword)
commit = result[0] # 获取最新的提交记录
author = commit['author']['login']
published_at = commit['published_at']
link = commit['html_url']
# 将每个项目的详细信息存储在一个字典中
project_info = {
'link': link,
'published_at': published_at,
'author': author,
'keyword': keyword
}
# print(project_info)
all_results.append(project_info)
time.sleep(5)
# 将所有结果写入JSON文件
save_to_json(all_results, './JSON/github_release.json')
def github_main_user(key):
all_results = [] # 用于存储所有结果
for keyword in key:
@@ -172,7 +204,7 @@ def github_main_user(key):
}
# print(project_info)
all_results.append(project_info)
time.sleep(10)
time.sleep(5)
# 将所有结果写入JSON文件
save_to_json(all_results, './JSON/github_user.json')
@@ -182,6 +214,7 @@ def github_main():
github_main_keyword(keyword_list)
if tool_list:
github_main_repo(tool_list)
github_main_release(tool_list)
if user_list:
github_main_user(user_list)