From e002322189f8e89674bd90d49bdcbe67f55841bb Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Fri, 7 Sep 2018 15:17:54 -0700 Subject: [PATCH] Add a 24-hour reminder tweet for Splatfests --- src/app/twitter/tweets/SplatfestTweet.js | 12 +++++++++++- src/web/components/splatoon/SplatfestBox.vue | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/app/twitter/tweets/SplatfestTweet.js b/src/app/twitter/tweets/SplatfestTweet.js index 2b90f57..124bc70 100644 --- a/src/app/twitter/tweets/SplatfestTweet.js +++ b/src/app/twitter/tweets/SplatfestTweet.js @@ -54,6 +54,11 @@ class SplatfestTweet extends TwitterPostBase { festival = this.getFestivals(region).find(f => f.times.end == this.getDataTime()); if (festival) return { festival, type: 'end' }; + + // Festival 24-hour reminder + festival = this.getFestivals(region).find(f => f.times.start == this.getDataTime() + 24 * 60 * 60); + if (festival) + return { festival, type: 'reminder' }; } // Which regions have this Splatfest? @@ -86,7 +91,7 @@ class SplatfestTweet extends TwitterPostBase { } getImage(data) { - return captureSplatfestScreenshot(this.region, data.festival.times[data.type], this.regions(data)); + return captureSplatfestScreenshot(this.region, this.getDataTime(), this.regions(data)); } getText(data) { @@ -105,6 +110,11 @@ class SplatfestTweet extends TwitterPostBase { return `The ${isGlobal ? 'global' : regionDemonyms} Splatfest is now open! #splatfest #splatoon2`; return `The Splatfest is now open in ${this.regionInfo.name}! #splatfest #splatoon2`; + case 'reminder': + if (isSimultaneous) + return `Reminder: The ${isGlobal ? 'global' : regionDemonyms} Splatfest starts in just 24 hours! #splatfest #splatoon2`; + return `Reminder: The Splatfest starts in ${this.regionInfo.name} in just 24 hours! #splatfest #splatoon2`; + case 'end': let hours = (data.festival.times.result - this.getDataTime()) / 60 / 60; let duration = (hours == 1) ? '1 hour' : `${hours} hours`; diff --git a/src/web/components/splatoon/SplatfestBox.vue b/src/web/components/splatoon/SplatfestBox.vue index f201958..344bafe 100644 --- a/src/web/components/splatoon/SplatfestBox.vue +++ b/src/web/components/splatoon/SplatfestBox.vue @@ -53,7 +53,12 @@