Unify server, persist ratings via API, refresh scraper data
All checks were successful
Build and Push / build (push) Successful in 13s
All checks were successful
Build and Push / build (push) Successful in 13s
- Replace split setup (ratings_server.py on :8081 + http.server on :8080) with a single combined Flask server (server.py) on :8080 that serves static files and the /api/ratings GET/POST endpoints - Ratings are now persisted server-side: mapa_bytu.html loads ratings from GET /api/ratings on startup (API as source of truth) and POSTs on every change — enables cross-browser and cross-device state sharing while keeping localStorage as a synchronous read cache - Dockerfile: install flask, copy server.py instead of ratings_server.py, expose only port 8080 - entrypoint.sh: start single server process instead of two - Makefile: add serve / serve-debug targets for local development - scrape_psn.py: fix log label, add --max-pages stub arg for CLI parity - Refresh all scraped property data Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -234,7 +234,7 @@ def scrape(max_properties: int | None = None):
|
||||
|
||||
logger.info(f"\n{'=' * 60}")
|
||||
logger.info(f"Výsledky PSN:")
|
||||
logger.info(f" Staženo jednotek: {len(all_units)}")
|
||||
logger.info(f" Staženo inzerátů: {len(all_units)}")
|
||||
for reason, count in excluded.items():
|
||||
if count:
|
||||
logger.info(f" Vyloučeno ({reason}): {count}")
|
||||
@@ -246,6 +246,8 @@ def scrape(max_properties: int | None = None):
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Scrape apartments from PSN.cz")
|
||||
parser.add_argument("--max-pages", type=int, default=None,
|
||||
help="Ignored — PSN uses a single API call, no pagination")
|
||||
parser.add_argument("--max-properties", type=int, default=None,
|
||||
help="Maximum number of properties to include in results")
|
||||
parser.add_argument("--log-level", type=str, default="INFO",
|
||||
|
||||
Reference in New Issue
Block a user