File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 55"""
66
77import os
8+ import sys
89import json
910import anthropic
1011from typing import Dict , Any , List
@@ -246,13 +247,25 @@ def main():
246247 """Main entry point"""
247248 import sys
248249 from datetime import datetime
250+ from pathlib import Path
249251
250- # Check for input file
251- if len (sys .argv ) < 2 :
252- print ("Usage: python evaluate_candidates.py <candidates_file.json>" )
253- return 1
254-
255- input_file = sys .argv [1 ]
252+ # Auto-find latest scan file or use provided file
253+ if len (sys .argv ) >= 2 :
254+ input_file = sys .argv [1 ]
255+ else :
256+ # Auto-find latest scan file
257+ candidates_dir = Path ('data/candidates' )
258+ if not candidates_dir .exists ():
259+ print ("❌ No candidates directory found. Run monitor_news.py first." )
260+ return 1
261+
262+ scan_files = sorted (candidates_dir .glob ('scan-*.json' ))
263+ if not scan_files :
264+ print ("❌ No scan files found. Run monitor_news.py first." )
265+ return 1
266+
267+ input_file = str (scan_files [- 1 ])
268+ print (f"📂 Auto-selected latest scan: { input_file } " )
256269
257270 # Load candidates
258271 try :
You can’t perform that action at this time.
0 commit comments