Compare commits

...

2 Commits

Author SHA1 Message Date
Rosalina ca88b0e490
cleanup splashcat exporter slightly 2023-12-03 18:05:48 -05:00
Rosalina 0a90da9b21
better readme 2023-12-03 18:05:25 -05:00
2 changed files with 12 additions and 16 deletions

View File

@ -3,7 +3,7 @@
[![Build status](https://github.com/spacemeowx2/s3si.ts/workflows/Build/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml) [![Build status](https://github.com/spacemeowx2/s3si.ts/workflows/Build/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/ci.yaml)
[![Constant check status](https://github.com/spacemeowx2/s3si.ts/workflows/Constant%20Check/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml) [![Constant check status](https://github.com/spacemeowx2/s3si.ts/workflows/Constant%20Check/badge.svg)](https://github.com/spacemeowx2/s3si.ts/actions/workflows/constant-check.yaml)
Export your battles from SplatNet to stat.ink. Export your battles from SplatNet to stat.ink and Splashcat.
If you have used s3s, please see [here](#migrate-from-s3s). If you have used s3s, please see [here](#migrate-from-s3s).
@ -17,9 +17,9 @@ If you have used s3s, please see [here](#migrate-from-s3s).
``` ```
Options: Options:
--profile-path <path>, -p Path to config file (default: ./profile.json) --profile-path <path>, -p Path to config file (default: ./profile.json)
--exporter <exporter>, -e Exporter list to use (default: stat.ink) --exporter <exporter>, -e Exporter list to use (default: stat.ink,splashcat)
Multiple exporters can be separated by commas Multiple exporters can be separated by commas
(e.g. "stat.ink,file") (e.g. "stat.ink,file,splashcat")
--list-method When set to "latest", the latest 50 matches will be obtained. --list-method When set to "latest", the latest 50 matches will be obtained.
When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches). When set to "all", matches of all modes will be obtained with a maximum of 250 matches (5 modes x 50 matches).
When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes. When set to "auto", the latest 50 matches will be obtained. If 50 matches have not been uploaded yet, matches will be obtained from the list of all modes.
@ -38,6 +38,10 @@ Options:
- If you want to use a different profile, use `-p` to specify the path to the - If you want to use a different profile, use `-p` to specify the path to the
profile file. profile file.
### Splashcat Notes
Splashcat requires battles uploaded to use `en-US` (set with `userLang`). Splashcat will localize battle results into the user's language when displayed.
### Track your rank ### Track your rank
- Run - Run
@ -71,7 +75,8 @@ Options:
// userLang will effect the language of the exported games to stat.ink // userLang will effect the language of the exported games to stat.ink
"userLang": "zh-CN", "userLang": "zh-CN",
"userCountry": "JP", "userCountry": "JP",
"statInkApiKey": "..." "statInkApiKey": "...",
"splashcatApiKey": "..."
} }
``` ```
@ -95,3 +100,4 @@ Then run `s3si.ts`, and it will work without login prompt.
- https://github.com/frozenpandaman/s3s - https://github.com/frozenpandaman/s3s
- https://github.com/fetus-hina/stat.ink - https://github.com/fetus-hina/stat.ink
- forked from https://github.com/spacemeowx2/s3si.ts

View File

@ -8,8 +8,6 @@ import {
GameExporter, GameExporter,
Nameplate, Nameplate,
PlayerGear, PlayerGear,
StatInkPostBody,
VsHistoryDetail,
VsInfo, VsInfo,
VsPlayer, VsPlayer,
VsTeam, VsTeam,
@ -17,8 +15,6 @@ VsTeam,
import { base64, msgpack, Mutex } from "../../deps.ts"; import { base64, msgpack, Mutex } from "../../deps.ts";
import { APIError } from "../APIError.ts"; import { APIError } from "../APIError.ts";
import { import {
b64Number,
gameId,
parseHistoryDetailId, parseHistoryDetailId,
} from "../utils.ts"; } from "../utils.ts";
import { Env } from "../env.ts"; import { Env } from "../env.ts";
@ -61,13 +57,7 @@ class SplashcatAPI {
body: msgpack.encode(body), body: msgpack.encode(body),
}); });
const json: unknown = {}//await resp.json().catch(() => ({})); const json = await resp.json();
console.log(json)
// read the body again as text
const text = await resp.text();
console.log(text);
if (resp.status !== 200 && resp.status !== 201) { if (resp.status !== 200 && resp.status !== 201) {
throw new APIError({ throw new APIError({
@ -117,7 +107,7 @@ export class SplashcatExporter implements GameExporter {
} else { } else {
return { return {
status: "skip", status: "skip",
reason: "Splashcat API does not support Salmon Run", reason: "Splashcat does not support Salmon Run",
} }
} }
} }