[src/] A static react website which displays player data
[cron/] A cron job which pulls connect codes from a google sheet, player data from slippi, and writes that data to json files in cron/data/, and then redeploys the static site.
Caveats
The undocumented slippi api this depends on may break at any time
This project takes extra consideration to avoid slamming the slippi servers with api calls, please be considerate of this.
Logic for determining ranks may become out of sync with the official slippi rank logic
I would appreciate if you keep my ‘by me a coffee’ link and give me credit for building this in your leaderboard.
Colorado Ranked Slippi Leaderboard
Code powering https://grantismo.github.io/CoSlippiLeaderboard/#/
Technologies
Fork of reacts-pages-boilerplate
How it works
The leaderboard is built from two programs:
cron/data/, and then redeploys the static site.Caveats
Getting started
git clone https://github.com/Grantismo/CoSlippiLeaderboard.gitnvm use 18.12.0. This will ensure that you are running the supported version of Node.js.npm install --global yarnyarn(from your code directory).gh auth loginIf you want to collect connect codes from a google form
secrets/creds.jsonspreadsheetIDin settings.js to your google sheet IDIf you want to manually populate your list of connect codes:
getPlayerConnectCodesto supply the list directly (see https://github.com/costasford/NorcalSlippiLeaderboard/blob/master/cron/fetchStats.ts#L11-L13)import { GoogleSpreadsheet } from 'google-spreadsheet';andimport creds from '../secrets/creds.json';fromcron/fetchStats.tsTest your cronjob
./cron/run.shtail -f cron/logs/log.txtTest the web app
npm startand open http://localhost:8262/ in your browse.Final steps
git add .git commit -m "Describe your commit here"crontab -e:Common issues:
sudo service cron status/bin/sh: 1: npm: not found, npm is not in the path when running the cron job.cron/run.sh. See https://stackoverflow.com/a/14612507Settings
settings.js file includes all important settings that should be used to setup deployments to gh-pages:
https://docs.google.com/spreadsheets/d/[YOUR ID]scripts
npm start– starts development server with webpack-dev-servernpm run build– builds project to productionnpm run deploy– builds and deploys project to Github pages./cron/run.sh- manually runs the cron jobSupport me
☕ buy me a coffee