Artikel 15-17, 22-24, 27-28; H1 in der Score-Bewertung

This commit is contained in:
2026-09-22 14:38:02 +02:00
parent 28912cf493
commit afc132f7b8
4 changed files with 106 additions and 85 deletions

20
build/briefe_holen.py Normal file
View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
"""Holt briefe/brief-SLUG.json aus Gitea nach build/lokal/briefe/SLUG.json. Aufruf: python3 build/briefe_holen.py SLUG [...]"""
import base64, json, os, sys
exec(open(os.path.join(os.path.dirname(__file__), 'push_gitea.py'), encoding='utf-8').read().split('def sammle')[0])
os.makedirs('build/lokal/briefe', exist_ok=True)
for s in sys.argv[1:]:
code, d = ruf('GET', f"{REPO}/contents/briefe/brief-{s}.json?ref=main")
if code != 200:
print('fehlt', s); continue
b = json.loads(base64.b64decode(d['content']).decode())
json.dump(b, open(f'build/lokal/briefe/{s}.json', 'w', encoding='utf-8'), ensure_ascii=False, indent=2)
z = b.get('zusatz', {})
print(f"== {s} | {b['query_id']} | Ziel {b['wortzahl_ziel']}")
print(' Pflicht:', ' | '.join(f"{x['begriff']}:{x['min']}-{x['max']}" for x in b['begriffe_pflicht']))
print(' Titel:', ', '.join(z.get('begriffe_titel', [])))
print(' Desc:', ', '.join(z.get('begriffe_description', [])))
print(' H2:', ', '.join(z.get('begriffe_h2', [])[:25]))
erw = sorted(b['begriffe_erweitert'], key=lambda x: -(x['bei_wettbewerbern_pc'] or 0))
print(' Erweitert:', ', '.join(x['begriff'] for x in erw[:45]))
print(' Fragen:', ' / '.join(f['frage'] for f in b['fragen'][:8]))