From 8fb03c9fa4c26e1db698457a50ec77f849cb8a6c Mon Sep 17 00:00:00 2001 From: Marc Farra Date: Thu, 30 May 2024 22:38:33 +0300 Subject: [PATCH] changes to API --- README.md | 31 +++++++++++++++++++++++++++++++ index.html | 18 +++++++++--------- main.js | 7 ++++--- metadata_template.json | 3 ++- 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1896041..5a287a6 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,34 @@ View the list of FIDE players and their ratings. The source of the data is the [ - The Datasette API is available at [https://fide-players.fly.dev/players](https://fide-players.fly.dev/players) - The HTML page is available at [https://kamicut.cc/fide-players/](https://kamicut.cc/fide-players/) - TODO: A Github Action to update the data daily + +## Run locally + +Clone the repository and install the dependencies: + +```bash +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +Run the script to download the data and create the database: + +```bash +curl -O http://ratings.fide.com/download/players_list_xml.zip +unzip players_list_xml.zip +mv players_list_xml_foa.xml players.xml +python players.py players.xml players.db +``` + +Run the API locally: + +```bash +datasette players.db -m metadata.json +``` + +Open the HTML page in a browser: + +```bash +open index.html +``` diff --git a/index.html b/index.html index 0c4b7b3..328f43b 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + FIDE Player Selector @@ -75,14 +75,14 @@ -