Single-page web service that scrapes the daily Arabic crossword from addiyar.com and returns a combined PDF.
main.py— FastAPI app, serves the static UI from/and the API under/api/*crosswords.py— fetch + crop + PDF assembly logicstatic/— single-page UI; saves user config in browser localStorageconfig.yaml— server-side defaults only (used the first time a browser loads the page)
The server is stateless. Each request carries from_date, max_count, target_page. The response includes X-Next-Date so the UI auto-advances for the next run.
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000Then open http://localhost:8000.
docker build -t crosswords .
docker run --rm -p 8000:8000 crosswordsCI builds and pushes to ghcr.io/overdrivegain/crosswords on every push to master.
GET /— UIGET /api/health—{"ok": true}GET /api/defaults— defaults fromconfig.yamlPOST /api/run— body{from_date, max_count, target_page}, returns the combined PDFGET /api/docs— OpenAPI / Swagger UI