fix: QC-Ratings aus 7 älteren Artikeln entfernt (CHECK 10)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
API_KEY="de3b01db-9be3-4c80-bd80-d47e071b320e"
|
||||
UA = "BSN-OpenClaw/1.0 (Brettspiel-News.de; kontakt@brettspiel-news.de)"
|
||||
|
||||
forums = {
|
||||
25: "Articles & Blogs",
|
||||
30: "Videos & Podcasts",
|
||||
26: "Board Game Design",
|
||||
}
|
||||
|
||||
for fid, fname in forums.items():
|
||||
url = f"https://boardgamegeek.com/xmlapi2/forum?id={fid}&page=1"
|
||||
cmd = [
|
||||
"curl", "-s", "--max-time", "15",
|
||||
"-H", f"User-Agent: {UA}",
|
||||
"-H", f"Authorization: Bearer {API_KEY}",
|
||||
url,
|
||||
]
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
outfile = f"/home/hermes/workspace/bgg-scrape/forum{fid}.xml"
|
||||
with open(outfile, "w") as f:
|
||||
f.write(result.stdout)
|
||||
|
||||
thread_count = result.stdout.count("<thread ")
|
||||
print(f"Forum {fid} ({fname}): {len(result.stdout)} bytes, {thread_count} threads")
|
||||
|
||||
print("Done.")
|
||||
Reference in New Issue
Block a user