added a script to check for dupe comments

This commit is contained in:
2026-02-24 01:50:27 -06:00
parent 4089d82c41
commit fd2b3c8480
5 changed files with 48 additions and 0 deletions

14
scripts/check_dupes.py Normal file
View File

@@ -0,0 +1,14 @@
import json
comments = json.load(open("docs/comments.json", encoding="utf-8"))
seen, dupes = {}, 0
for i, c in enumerate(comments):
k = (c.get("id",""), c.get("text",""), c.get("timestamp",0))
if k in seen:
dupes += 1;
print(f" Index {i} dupes {seen[k]} | id={k[0]} | ts={k[2]} | text={k[1][:80]}")
else:
seen[k] = i
print(f"Found {dupes} duplicate(s)" if dupes else f"No duplicates among us.")