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

Function main

scripts/feishu_feedback_cli.py:74–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72def main():
73 print("=" * 60)
74 print("飞书反馈处理器 - 半自动模式")
75 print("=" * 60)
76 print()
77
78 # 1. 获取用户 ID
79 user_id = input("用户 ID [默认:user_001]: ").strip() or "user_001"
80
81 # 2. 加载今日推送
82 print("\n加载今日推送...")
83 papers = load_today_push()
84
85 if not papers:
86 print("未找到论文数据,退出")
87 return
88
89 print(f"加载了 {len(papers)} 篇论文")
90
91 # 3. 循环处理反馈
92 print("\n" + "-" * 60)
93 print("请从飞书复制用户回复,粘贴到下方(输入 q 退出):")
94 print("支持格式:1 2 4 6 | 1-5 6 9 | 1,2,4,6")
95 print("-" * 60)
96
97 while True:
98 print()
99 reply = input("回复:").strip()
100
101 if reply.lower() in ('q', 'quit', 'exit'):
102 print("退出")
103 break
104
105 if not reply:
106 continue
107
108 # 解析回复
109 selected = parse_user_reply(reply)
110
111 if not selected:
112 print("未识别到有效编号,请重新输入")
113 continue
114
115 print(f"选中论文编号:{sorted(selected)}")
116
117 # 处理反馈
118 push_id = f"manual_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
119
120 result = process_feedback(
121 user_id=user_id,
122 push_id=push_id,
123 reply=reply,
124 papers=papers,
125 feishu_user_id=None # 不发送飞书确认
126 )
127
128 print("\n处理结果:")
129 print(f" 选中:{result.get('selected_count', 0)} 篇")
130 print(f" 跳过:{result.get('skipped_count', 0)} 篇")
131 print(f" 选择率:{result.get('selection_rate', 0):.1%}")

Callers 1

Calls 6

load_today_pushFunction · 0.85
parse_user_replyFunction · 0.85
process_feedbackFunction · 0.85
nowMethod · 0.80
getMethod · 0.80
get_profileFunction · 0.50

Tested by

no test coverage detected