-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (32 loc) · 1.05 KB
/
Copy pathmain.py
File metadata and controls
40 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
import asyncio
import json
from pathlib import Path
from pdf_generator import main as generate_report
from scraper import run_full_scrape
from analyze_local import main as run_analysis
from delete_screenshots import delete_screenshots
async def run_scraper(url: str) -> None:
payload = await run_full_scrape(url)
output_path = Path("scrape_results.json")
output_path.write_text(json.dumps(payload, indent=2), encoding="utf-8")
print(f"Saved scrape results to {output_path}")
async def main():
if len(sys.argv) > 1:
url = sys.argv[1]
else:
url = "https://www.paidtobringpeace.com/blueprints"
# 1. Scrape the website
print(f"Scraping {url}...")
await run_scraper(url)
# 2. Analyze the components using Claude
print("Running AI analysis...")
await run_analysis()
# 3. Generate the PDF
print("Generating PDF...")
generate_report()
# 4. Clean up screenshots
print("Cleaning up temporary screenshots...")
delete_screenshots()
if __name__ == "__main__":
asyncio.run(main())