Move the SplatNet user agent string to .env

This way, if someone else uses the library it won't be attributed to splatoon2.ink.
This commit is contained in:
Matt Isenhower
2017-09-20 12:10:00 -07:00
parent d2988f06ce
commit c50aea150c
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
# Nintendo SplatNet 2 "iksm_session" value
NINTENDO_SESSION_ID=
# (Optional) User agent string for SplatNet requests
SPLATNET_USER_AGENT=
# Google Calendar ICS URL for Salmon Run schedules
# Provided by: https://www.reddit.com/user/thejellydude
SALMON_RUN_CALENDAR_ICS_URL=https://calendar.google.com/calendar/ical/7e5g474p0ng7vaejkg3mkomhks%40group.calendar.google.com/public/basic.ics

View File

@@ -4,7 +4,7 @@ const path = require('path');
const axios = require('axios');
// SplatNet2 API
const userAgent = 'splatoon2inkbot/1.0 (+https://splatoon2.ink)';
const userAgent = process.env.SPLATNET_USER_AGENT;
const splatnetBaseUrl = 'https://app.splatoon2.nintendo.net';
const api = axios.create({
baseURL: `${splatnetBaseUrl}/api/`,