Skip to content

yukidaruma/splatoon-stats-api

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
sql
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

splatoon-stats-api

Overview

This program fetches

  • League Ranking every 2 hours.
  • Splatfest schedules every day. If there's unfetched splatfest rankings, fetch them too.
  • X Ranking at every first day of the month.

Install

git clone https://github.com/yukidaruma/splatoon-stats-api.git
cd splatoon-stats-api
npm install
docker-compose build

Start

docker-compose up postgres -d

# Install pm2 if not installed.
npm install -g pm2
pm2 start npm --name splatoon-stats -- run start

# You can use these commands as soon as PM2 daemon has started
pm2 logs
pm2 stop spatoon-stats

You need to run following setup commands before first run.

cat << EOF > .env # Create .env file to override settings in config.js
IKSM_SESSION=<your iksm session>
EOF
npm run setup


# Optional steps:
# Note these 2 commands has long interval between fetching.
# It's recommended to use screen/tmux to run these tasks in background.

# Run if you want past league rankings. By default, it will fetch all league rankings since 2018-01-01.
npm run fetch-league-rankings

# Run if you want past x rankings. By default, it will fetch all x rankings since 2018-05.
npm run fetch-x-rankings

Third-party APIs

This app is using following third-party APIs.