Since the method of viewing the data of squid ring 2 on a PC browser has been improved, I referred to it. [Splatoon 2] Forcibly browse the battle record data of Squid Ring 2 with a PC browser
Python 3.6.1
When I was writing this article, I found something that was easy to understand. There seems to be a way to see Squid Ring 2 on a PC browser, so I tried it
Make a note of the cookie value using the method described in this link.
ikaring.py
import urllib
from urllib.request import build_opener, HTTPCookieProcessor
from urllib.parse import urlencode
import http
from http.cookiejar import CookieJar
import codecs
def printJson(url): #Get Json and print
cookie = "iksm_session=Noted cookie value"
opener = build_opener(HTTPCookieProcessor(CookieJar()))
opener.addheaders.append(("Cookie", cookie))
res = opener.open(url)
print (codecs.decode(res.read(), 'unicode-escape'))
printJson("https://app.splatoon2.nintendo.net/api/data/stages") #Get the current stage
#printJson("https://app.splatoon2.nintendo.net/api/festivals/active") #Get information about festivals?
#printJson("https://app.splatoon2.nintendo.net/api/schedules") #Get schedule
#printJson("https://app.splatoon2.nintendo.net/api/records") #Acquisition of current equipment and painted area
#printJson("https://app.splatoon2.nintendo.net/api/timeline") #Friend status?
#printJson("https://app.splatoon2.nintendo.net/api/onlineshop/merchandises") #Gear shop information
#printJson("https://app.splatoon2.nintendo.net/api/results/110") #Data for each battle
Since it is returned in Json like this, it is easy to process in various ways.
There may be other data that can be obtained.
110 of https://app.splatoon2.nintendo.net/api/results/110
corresponds to each battle.
If you want to access the data of the 109th battle, you can do https://app.splatoon2.nintendo.net/api/results/109
.
Note that the number of battles and the last 50 battles differ depending on the person.
Since you can only see the history of the latest 50 battles, it seems that you can use it to record the data of each battle. Since you can see not only yourself but also the gears of your friends and opponents, if you collect a lot of data, you will be able to perform data mining such as situations that you are good at / not good at.
Recommended Posts