MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / load_today_push

Function load_today_push

scripts/feishu_feedback_cli.py:39–71  ·  view source on GitHub ↗

从今日推送文件加载论文列表

()

Source from the content-addressed store, hash-verified

37
38def load_today_push() -> list:
39 """从今日推送文件加载论文列表"""
40 import glob
41
42 # 查找今天的推送文件
43 push_files = glob.glob("test_push*.txt")
44
45 if not push_files:
46 print("未找到推送文件,请先运行 daily-push")
47 return []
48
49 # 读取最新的推送文件
50 latest_file = max(push_files, key=os.path.getmtime)
51 print(f"读取推送文件:{latest_file}")
52
53 papers = []
54 with open(latest_file, 'r', encoding='utf-8') as f:
55 for line in f:
56 # 匹配格式:01. 2604.07258v1: 标题
57 import re
58 match = re.match(r'^\s*(\d+)\.\s*([\w\.]+):\s*(.+)$', line)
59 if match:
60 num = int(match.group(1))
61 arxiv_id = match.group(2)
62 title = match.group(3)
63 papers.append({
64 "id": num,
65 "arxiv_id": arxiv_id,
66 "title": title
67 })
68
69 return papers
70
71
72def main():
73 print("=" * 60)
74 print("飞书反馈处理器 - 半自动模式")

Callers 1

mainFunction · 0.85

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected