diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-02-17 18:11:46 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-02-17 18:11:46 +0100 |
commit | 2e4b9dc1cc48e5d35243bcef32b8acd29171bf23 (patch) | |
tree | 619cb2bfd1f41430d7b834a54738a8ca512fa36a /src | |
parent | 4da5def0e14dbbbbdd7396921799b4753f073c26 (diff) |
Move school spesific files to school spesifc folders
Diffstat (limited to 'src')
-rw-r--r-- | src/server/lib/schools/hetmml/getScheduleData.js (renamed from src/server/lib/getMeetingpointData.js) | 8 | ||||
-rw-r--r-- | src/server/lib/schools/hetmml/getURLOfUser.js (renamed from src/server/lib/getURLOfUser.js) | 0 | ||||
-rw-r--r-- | src/server/routes/getSchedule.js | 6 | ||||
-rw-r--r-- | src/server/routes/index.js | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/server/lib/getMeetingpointData.js b/src/server/lib/schools/hetmml/getScheduleData.js index c1de28a..303af6d 100644 --- a/src/server/lib/getMeetingpointData.js +++ b/src/server/lib/schools/hetmml/getScheduleData.js @@ -81,7 +81,7 @@ function getAlts(users) { })); } -function getMeetingpointData() { +function getScheduleData() { const navbarRequests = [ request('http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/frames/navbar.htm', { timeout: 5000 }), request('http://www.meetingpointmco.nl/Roosters-AL/doc/basisroosters/frames/navbar.htm', { timeout: 5000 }), @@ -111,9 +111,9 @@ function getMeetingpointData() { }); } -function getMeetingpointDataCacheWrapper() { +function getScheduleDataCacheWrapper() { if (meetingpointData == null || new Date() - lastUpdate > 30 * 60 * 1000) { // 30 minutes - return getMeetingpointData().then((meetingpointData_) => { + return getScheduleData().then((meetingpointData_) => { lastUpdate = new Date(); meetingpointData = meetingpointData_; @@ -124,4 +124,4 @@ function getMeetingpointDataCacheWrapper() { return Promise.resolve(meetingpointData); } -module.exports = debounce(getMeetingpointDataCacheWrapper); +module.exports = debounce(getScheduleDataCacheWrapper); diff --git a/src/server/lib/getURLOfUser.js b/src/server/lib/schools/hetmml/getURLOfUser.js index f44d1a3..f44d1a3 100644 --- a/src/server/lib/getURLOfUser.js +++ b/src/server/lib/schools/hetmml/getURLOfUser.js diff --git a/src/server/routes/getSchedule.js b/src/server/routes/getSchedule.js index 9d965bf..1734cd8 100644 --- a/src/server/routes/getSchedule.js +++ b/src/server/routes/getSchedule.js @@ -4,8 +4,8 @@ const router = express.Router(); const request = require('request'); const iconv = require('iconv-lite'); -const getMeetingpointData = require('../lib/getMeetingpointData'); -const getURLOfUser = require('../lib/getURLOfUser'); +const getScheduleData = require('../lib/schools/hetmml/getScheduleData'); +const getURLOfUser = require('../lib/schools/hetmml/getURLOfUser'); // copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js, // were using the same code as they do to be sure that we always get the same @@ -25,7 +25,7 @@ function getWeekNumber(target) { } router.get('/:type/:value', (req, res, next) => { - getMeetingpointData().then(({ users }) => { + getScheduleData().then(({ users }) => { const { type, value } = req.params; let { week } = req.query; const user = diff --git a/src/server/routes/index.js b/src/server/routes/index.js index d58962d..af82e1f 100644 --- a/src/server/routes/index.js +++ b/src/server/routes/index.js @@ -1,11 +1,11 @@ const express = require('express'); const router = express.Router(); -const getMeetingpointData = require('../lib/getMeetingpointData'); +const getScheduleData = require('../lib/schools/hetmml/getScheduleData'); /* GET home page. */ router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], (req, res) => { - getMeetingpointData().then(({ users, dailyScheduleWeeks, basisScheduleWeeks }) => { + getScheduleData().then(({ users, dailyScheduleWeeks, basisScheduleWeeks }) => { const isBeta = process.env.BETA === '1'; const flags = []; |