-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextract_css.py
More file actions
21 lines (21 loc) · 1.05 KB
/
extract_css.py
File metadata and controls
21 lines (21 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
import json
path = "/Users/alekespinosa/.cursor/projects/Users-alekespinosa-Documents-CIS-Courses-CIS-4375-CIS-4375-Project/agent-transcripts/f2bd04c4-813c-408c-a765-9a22e491b15a/f2bd04c4-813c-408c-a765-9a22e491b15a.jsonl"
with open(path, "r", encoding="utf-8", errors="replace") as f:
for line in f:
if len(line) < 30000:
continue
o = json.loads(line)
msg = o.get("message", {})
content = msg.get("content")
if isinstance(content, list):
for block in content:
if isinstance(block, dict) and block.get("type") == "text":
t = block.get("text", "")
if "Home — General_Dashboard" in t and len(t) > 5000:
idx = t.find("/* Home —")
if idx >= 0:
with open("/tmp/extracted2.css", "w", encoding="utf-8") as out:
out.write(t[idx:])
print("found", len(t))
raise SystemExit(0)
print("not found")