~shreyasminocha/rice-dining-api

1944eb6e5d09093b749705e5814956cf7ed21510 — Shreyas Minocha 2 years ago 2d120e3 main
Update menu file location
1 files changed, 3 insertions(+), 3 deletions(-)

M src/scrape.js
M src/scrape.js => src/scrape.js +3 -3
@@ 5,11 5,11 @@ import pageify from './pageify.js';
import mealToData from './meal-to-data.js';

const api = got.extend({
	prefixUrl: 'https://web-api3.rice.edu',
	prefixUrl: 'https://staticws.b-cdn.net',
});

async function getDailyMenu(servery) {
	const res = await api.get(`static/${servery}-menu-new.js`);
	const res = await api.get(`dining/${servery}-menu-new.js`);
	const menuHtml = eval(res.body + `${camelcase(servery)}MenuTemplate()`); // eval bad
	const dom = new jsdom.JSDOM(pageify(menuHtml));
	const mealsDom = dom.window.document.querySelectorAll('.inside-daily-menu .item:not(.legend)');


@@ 18,7 18,7 @@ async function getDailyMenu(servery) {
}

async function getFullWeekMenu(servery) {
	const res = await api.get(`static/${servery}-menu-full-week-new.js`);
	const res = await api.get(`dining/${servery}-menu-full-week-new.js`);
	const menuHtml = eval(res.body + `${camelcase(servery)}MenuFullWeekTemplate()`);
	const dom = new jsdom.JSDOM(pageify(menuHtml));
	const mealsDom = dom.window.document.querySelectorAll('.weekly-menu .item:not(.legend)');