Coder Social home page Coder Social logo

splatnet2statink's Introduction

splatnet2statink.py

A script that uploads battle data from the SplatNet 2 app ("Nintendo Switch Online," for use with Splatoon 2) to http://stat.ink/, a site for visualizing and aggregating statistics from Splatoon and Splatoon 2.

Usage

$ python splatnet2statink.py [-M] [-s] [-i path/to/results.json] [-t]

The -M flag runs the script in realtime monitoring mode, uploading new battle results as you play games.

The -s flag suppresses uploading the scoreboard result image.

The -i flag allows users to specify the path to a results JSON file to be used as input. Without this, the file is pulled from https://app.splatoon2.nintendo.net/api/results, given a valid cookie.

The -t flag sends the data to stat.ink as a dry run, without uploading, for testing/validation purposes.

Working features

  • Complete battle stats
    • Lobby/mode, stage, weapon
    • Result, final count/percent, turf inked
    • Kills, deaths, assists, specials
    • Rank & rank after, level & level after
    • Battle start & end times
    • Splatfest title & power
  • Monitoring for new battle results in real-time
  • Scoreboard stats & player ranking
  • Scoreboard/battle result image upload
  • Full automation of SplatNet cookie generation/acquisition via user log-in
  • Non-English language game support

To implement

  • Gear + ability recognition (waiting on stat.ink API v2)

Setup instructions

  1. Download and install Python 2.7 (pre-installed on macOS) and the package manager pip.

  2. From the command line (macOS: Terminal; Windows: Command Prompt/PowerShell), install the required Python libraries:

    pip install requests
    pip install msgpack-python
    

    If you're on Windows with multiple versions of Python installed, you'll have to use py -2 -m pip instead.

  3. Running the script for the first time will prompt you to enter your stat.ink API key, which can be found in your profile settings. You will then be asked to navigate to a specific URL on Nintendo.com, log in, and follow simple instructions to obtain your session_token. This token will automatically be entered into config.txt for you, and a cookie (used to access your SplatNet battle results) will be generated. You're now ready to upload battles!

  4. For players using the app in a language other than English, you can change user_lang in config.txt to match your game's language.

Have any questions, issues, or suggestions? Feel free to message me on Twitter or Reddit.

Accessing SplatNet 2 from your browser

If you wish to access the SplatNet site from your computer rather than via the phone app, navigate to https://app.splatoon2.nintendo.net/home (it should show a forbidden error). Use a cookie editor (such as EditThisCookie for Chrome) to edit the iksm_session cookie to be the same value as cookie in config.txt (generated after running the script for the first time), and refresh the page.

Splatoon 2 stage rotation information and current SplatNet gear are viewable at https://splatoon2.ink/.

splatnet2statink's People

Contributors

frozenpandaman avatar clovervidia avatar royxiang avatar mkody avatar

Watchers

James Cloos avatar mak4026 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.