From 564bb641d4fc22e8dbf24da7a0e8300e71ce36e1 Mon Sep 17 00:00:00 2001 From: MrRowey Date: Thu, 23 Dec 2021 19:55:51 +0000 Subject: [PATCH] v1.2 Remove Livestream page --- express.js | 1 - routes/views/livestream.js | 34 ----------------------------- templates/layouts/default.pug | 1 - templates/views/livestream.pug | 39 ---------------------------------- 4 files changed, 75 deletions(-) delete mode 100644 routes/views/livestream.js delete mode 100644 templates/views/livestream.pug diff --git a/express.js b/express.js index ad0d7c0d..11c88a7e 100644 --- a/express.js +++ b/express.js @@ -131,7 +131,6 @@ app.get('/account_activated', require(routes + 'accounts/get/register')); app.get('/password_resetted', require(routes + 'accounts/get/requestPasswordReset')); app.get('/report_submitted', require(routes + 'accounts/get/report')); app.get('/client', require(routes + 'client')); -app.get('/livestream', require(routes + 'livestream')); app.get('/contribution', require(routes + 'contribution')); app.get('/newshub', require(routes + 'newshub')); app.get('/competitive/tournaments', require(routes + 'tournaments')); diff --git a/routes/views/livestream.js b/routes/views/livestream.js deleted file mode 100644 index be5b8fc9..00000000 --- a/routes/views/livestream.js +++ /dev/null @@ -1,34 +0,0 @@ -var request = require('request'); - moment = require('moment'); - momentTimezone = require('moment-timezone'); - -exports = module.exports = function(req, res) { - - var locals = res.locals; - - // locals.section is used to set the currently selected - // item in the header navigation. - locals.section = 'livestream'; - - //Moment is used for converting timestamp to January 1st 2016... - locals.moment = moment; - locals.momentTimezone = momentTimezone; - - request( - { - url: process.env.TWITCH_LIVESTREAM_URL, - headers: {'Accept': 'application/vnd.twitchtv.v5+jsonp', 'Client-ID': process.env.TWITCH_CLIENT_ID} - }, - function (error, response, body) { - if (!error && response.statusCode == 200) { - locals.data = JSON.parse(body); - locals.streamsCount = locals.data._total; - } else { - locals.streamsCount = 0; - } - - // Render the view - res.render('livestream'); - }); - -}; diff --git a/templates/layouts/default.pug b/templates/layouts/default.pug index 740d95ca..3d74fe1d 100755 --- a/templates/layouts/default.pug +++ b/templates/layouts/default.pug @@ -42,7 +42,6 @@ html(lang='en') li: a(href="https://forum.faforever.com") Forums li: a(href="https://wiki.faforever.com") Wiki li: a(href="https://unitdb.faforever.com") Unit Database - li: a(href="/livestream") Live Streams li: a(href="https://discord.gg/hgvj6Af") Discord i.icon.fab.fa-discord li: a.icon(href="https://www.youtube.com/c/ForgedAllianceForever") diff --git a/templates/views/livestream.pug b/templates/views/livestream.pug deleted file mode 100644 index 0b5c795b..00000000 --- a/templates/views/livestream.pug +++ /dev/null @@ -1,39 +0,0 @@ -extends ../layouts/default - -block css - link(href="/styles/css/news.min.css", rel="stylesheet") - -//- MIXINS - -mixin stream(stream) - .col-md-4 - .newspanel - .panel.panel-default - .panel-heading - a.plain(href=stream.channel.url) - h3()!= stream.channel.status - .panel-body - p.text-muted Posted - if stream.created_at - | #{momentTimezone(stream.created_at).tz(momentTimezone.tz.guess()).fromNow()} - | on #{momentTimezone(stream.created_at).tz(momentTimezone.tz.guess()).format("MMMM Do YYYY")} - if stream.channel.display_name - | by  - a.primary-color(href=stream.channel.url) #{stream.channel.display_name} - div.excerpt - img(src=stream.preview.large) - p.text-muted.footer - span Current Viewers: #{stream.viewers} | Language: #{stream.channel.language} - -block content - .container.text-center - .col-md-12 - h1 Forged Alliance Forever Live Streams - h4 The Forged Alliance Forever live streams include all current live streams from Twitch.tv - hr - .col-md-12 - if streamsCount >= 1 - each stream in data.streams - +stream(stream) - else - h3.text-muted There are no live streams currently available.