From c50aea150cd5a7f225f27f62e64225c16fbba452 Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Wed, 20 Sep 2017 12:10:00 -0700 Subject: [PATCH] Move the SplatNet user agent string to .env This way, if someone else uses the library it won't be attributed to splatoon2.ink. --- .env.example | 3 +++ src/updater/splatnet.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 8b0db19..b2eb635 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/src/updater/splatnet.js b/src/updater/splatnet.js index 645a7bd..97f4deb 100644 --- a/src/updater/splatnet.js +++ b/src/updater/splatnet.js @@ -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/`,