This project is a Python script that tracks the LP (League Points) cutoffs for Challenger and Grandmaster ranks in League of Legends. It fetches data from Riot Games' API, stores it in an SQLite database, and posts updates to a Discord channel via webhooks. The code is designed with modularity and efficiency in mind, utilizing SQLite for lightweight, serverless, and self-contained SQL database management.
- Clone the repository.
git clone https://github.com/Allan-Cao/LoL-Ladder-Tracker.git
- Navigate to the project directory.
cd LoL-Ladder-Tracker
- Create a virtual environment.
py -m venv venv
- Activate the virtual environment.
- On macOS and Linux:
source venv/bin/activate
- On Windows:
.\venv\Scripts\activate
- On macOS and Linux:
- Install the required packages.
pip install -r requirements.txt
- Rename
env.example
to.env
and fill in your Riot API key and Discord Webhook.API_KEY=Your-API-Key DISCORD_WEBHOOK=Your-Webhook-URL
Run the script.
python main.py
This will populate the SQLite database and post the current LP cutoffs to the specified Discord channel.
For automated hourly updates, consider using crontab
on a Unix-based system.
crontab -e
Add the following line to schedule the script to run every hour.
0 * * * * /path/to/python /path/to/LoL-Ladder-Tracker/main.py
Please note that you will also have to modify the HISTORIC_FILE
variable to be an absolute path for crontab to run correctly.
This project is licensed under the MIT License. See the LICENSE file for more information.