Initial commit: What To Cook (WTC) v4.4 - Digitales Kochbuch, Wochenmenueplan & Buchdruck

This commit is contained in:
2026-10-14 20:24:37 +02:00
commit c01d2d7639
171 changed files with 14073 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import urllib.request
import json
payload = {
"slots": [
{"slot_number": 1, "chapter_number": 1},
{"slot_number": 2, "chapter_number": 3},
{"slot_number": 3, "chapter_number": 7},
{"slot_number": 4, "chapter_number": 10},
{"slot_number": 5, "chapter_number": 11}
]
}
data = json.dumps(payload).encode("utf-8")
req = urllib.request.Request("http://127.0.0.1:8003/api/roll", data=data, headers={"Content-Type": "application/json"})
res = urllib.request.urlopen(req)
result = json.loads(res.read().decode("utf-8"))
print("Status:", result.get("status"))
print("Slots rolled:")
for s in result.get("results", []):
recipe = s.get("recipe")
if recipe:
print(f" Slot {s.get('slot_number')}: {recipe.get('title')} (Kapitel {recipe.get('chapter_number')}: {recipe.get('category')})")
else:
print(f" Slot {s.get('slot_number')}: None ({s.get('message')})")