From d3839cae715fb745028bad6dbb7dc48fd90a6da5 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Tue, 3 Oct 2023 21:47:48 +0200 Subject: [PATCH] Update resto endpoints for locations --- server/scraper/resto/menu.py | 8 - server/static/resto/meta_2.0.json | 271 ++++++++++++++++++------------ 2 files changed, 167 insertions(+), 112 deletions(-) diff --git a/server/scraper/resto/menu.py b/server/scraper/resto/menu.py index 3d60df44..e5c73e56 100755 --- a/server/scraper/resto/menu.py +++ b/server/scraper/resto/menu.py @@ -33,16 +33,11 @@ "en": "https://www.ugent.be/en/facilities/restaurants/weekly-menu", "nl": "https://www.ugent.be/student/nl/meer-dan-studeren/resto/weekmenu", "nl-debrug-avond": "https://www.ugent.be/student/nl/meer-dan-studeren/resto/weekmenubrugavond", - "nl-coupure": "https://www.ugent.be/student/nl/meer-dan-studeren/resto/weekmenu", - "nl-dunant": "https://www.ugent.be/student/nl/meer-dan-studeren/resto/weekmenu", - "nl-merelbeke": "https://www.ugent.be/student/nl/meer-dan-studeren/resto/weekmenu", } NORMAL_WEEK = re.compile(r"week(\d+)$") INDIVIDUAL_DAY_URL_OVERRIDE = { "nl-coupure": r"week(\d+)coupure$", - "nl-dunant": r"week(\d+)(merelbekedunant|dunant)$", - "nl-merelbeke": r"week(\d+)(merelbekedunant|merelbeke)$", "nl-debrug": r"week(\d+)brugsterre|week(27)duurzaam|week(28)duurzaam", "nl-sterre": r"week(\d+)(brugsterre|sterre)|week(27)duurzaam", "nl-ardoyen": r"week(\d+)ardoyen" @@ -53,12 +48,9 @@ # which is very useful. COPIED_ENDPOINTS = { "nl-debrug": "nl", - "nl-heymans": "nl", - "nl-dunant": "nl", "nl-coupure": "nl", "nl-sterre": "nl", "nl-ardoyen": "nl", - "nl-merelbeke": "nl", } # Day names to day of the week. diff --git a/server/static/resto/meta_2.0.json b/server/static/resto/meta_2.0.json index 2fffdf42..1c028df4 100644 --- a/server/static/resto/meta_2.0.json +++ b/server/static/resto/meta_2.0.json @@ -1,106 +1,169 @@ { - "locations": [ - { - "name": "English menu", - "address": "Sint-Pietersnieuwstraat", - "latitude": 51.045113, - "longitude": 3.727347, - "type": "resto", - "endpoint": "en", - "open": {"resto":[["08:30", "15:00"]]} - },{ - "name": "Resto Campus Sterre", - "address": "Krijgslaan 281", - "latitude": 51.026024, - "longitude": 3.712939, - "type": "resto", - "endpoint": "nl-sterre", - "open": {"resto":[["08:30", "14:00"]]} - }, { - "name": "Resto Campus Heymans", - "address": "Harelbekestraat 70", - "latitude": 51.026508, - "longitude": 3.730189, - "type": "resto", - "endpoint": "nl-heymans", - "open": {"resto":[["08:30", "15:00"]]} - }, { - "name": "Resto De Brug", - "address": "Sint-Pietersnieuwstraat 45", - "latitude": 51.045613, - "longitude": 3.727147, - "type": "resto", - "endpoint": "nl-debrug", - "open": {"resto":[["08:30", "15:00"]], - "cafetaria":[["08:00", "16:00"]]} - }, { - "name": "Resto De Brug (avond)", - "address": "Sint-Pietersnieuwstraat 45", - "latitude": 51.045613, - "longitude": 3.727147, - "type": "resto", - "endpoint": "nl-debrug-avond", - "open": {"resto":[["17:30", "21:00"]]} - }, { - "name": "Resto Campus Merelbeke", - "address": "Salisburylaan 133, Merelbeke", - "latitude": 50.998369, - "longitude": 3.766454, - "type": "resto", - "endpoint": "nl-merelbeke", - "open": {"resto":[["08:30", "15:00"]]} - }, { - "name": "Resto Campus Dunant", - "address": "Henri Dunantlaan 2", - "latitude": 51.049023, - "longitude": 3.704017, - "type": "resto", - "endpoint": "nl-dunant", - "open": {"resto":[["08:30", "15:00"]]} - }, { - "name": "Resto Campus Coupure", - "address": "Coupure Links 653", - "latitude": 51.053252, - "longitude": 3.707671, - "type": "resto", - "endpoint": "nl-coupure", - "open": {"resto":[["08:30", "15:00"]]} - }, { - "name": "Resto Ardoyen", - "address": "Technologiepark-Zwijnaarde 75, 9052 Zwijnaarde", - "latitude": 51.010207, - "longitude": 3.707660, - "type": "resto", - "endpoint": "nl-ardoyen", - "open": {"resto":[["08:30", "15:00"]]} - }, { - "name": "Cafetaria Campus Boekentoren", - "address": "Blandijnberg 2", - "latitude": 51.043960, - "longitude": 3.725230, - "type": "cafetaria", - "open": {} - }, { - "name": "Cafetaria Campus UZ Gent", - "address": "Corneel Heymanslaan", - "latitude": 51.024360, - "longitude": 3.723540, - "type": "cafetaria", - "open": {"cafetaria":[["09:00", "14:30"]]} - }, { - "name": "Cafetaria Ledeganck", - "address": "Ledeganckstraat 35", - "latitude": 51.036520, - "longitude": 3.723990, - "type": "cafetaria", - "open": {} - }, { - "name": "Cafetaria Campus Aula", - "address": "Universiteitsstraat 4", - "latitude": 51.051029, - "longitude": 3.723928, - "type": "cafetaria", - "open": {} - } - ] + "locations": [ + { + "name": "English menu", + "address": "Sint-Pietersnieuwstraat", + "latitude": 51.045113, + "longitude": 3.727347, + "type": "resto", + "endpoint": "en", + "open": { + "resto": [ + [ + "08:30", + "15:00" + ] + ] + } + }, + { + "name": "Resto Campus Sterre", + "address": "Krijgslaan 281", + "latitude": 51.026024, + "longitude": 3.712939, + "type": "resto", + "endpoint": "nl-sterre", + "open": { + "resto": [ + [ + "08:30", + "14:00" + ] + ] + } + }, + { + "name": "Resto De Brug", + "address": "Sint-Pietersnieuwstraat 45", + "latitude": 51.045613, + "longitude": 3.727147, + "type": "resto", + "endpoint": "nl-debrug", + "open": { + "resto": [ + [ + "08:30", + "15:00" + ] + ], + "cafetaria": [ + [ + "08:00", + "16:00" + ] + ] + } + }, + { + "name": "Resto De Brug (avond)", + "address": "Sint-Pietersnieuwstraat 45", + "latitude": 51.045613, + "longitude": 3.727147, + "type": "resto", + "endpoint": "nl-debrug-avond", + "open": { + "resto": [ + [ + "17:30", + "21:00" + ] + ] + } + }, + { + "name": "Resto Campus Coupure", + "address": "Coupure Links 653", + "latitude": 51.053252, + "longitude": 3.707671, + "type": "resto", + "endpoint": "nl-coupure", + "open": { + "resto": [ + [ + "08:30", + "15:00" + ] + ] + } + }, + { + "name": "Resto Ardoyen", + "address": "Technologiepark-Zwijnaarde 75, 9052 Zwijnaarde", + "latitude": 51.010207, + "longitude": 3.707660, + "type": "resto", + "endpoint": "nl-ardoyen", + "open": { + "resto": [ + [ + "08:30", + "15:00" + ] + ] + } + }, + { + "name": "Cafetaria Campus Boekentoren", + "address": "Blandijnberg 2", + "latitude": 51.043960, + "longitude": 3.725230, + "type": "cafetaria", + "open": {} + }, + { + "name": "Cafetaria Campus UZ Gent", + "address": "Corneel Heymanslaan", + "latitude": 51.024360, + "longitude": 3.723540, + "type": "cafetaria", + "open": { + "cafetaria": [ + [ + "09:00", + "14:30" + ] + ] + } + }, + { + "name": "Cafetaria Ledeganck", + "address": "Ledeganckstraat 35", + "latitude": 51.036520, + "longitude": 3.723990, + "type": "cafetaria", + "open": {} + }, + { + "name": "Cafetaria Campus Aula", + "address": "Universiteitsstraat 4", + "latitude": 51.051029, + "longitude": 3.723928, + "type": "cafetaria", + "open": {} + }, + { + "name": "Cafetaria Heymans", + "address": "Harelbekestraat 70", + "latitude": 51.026508, + "longitude": 3.730189, + "type": "cafetaria", + "open": {} + }, + { + "name": "Cafetaria Merelbeke", + "address": "Salisburylaan 133, Merelbeke", + "latitude": 50.998369, + "longitude": 3.766454, + "type": "cafetaria", + "open": {} + }, + { + "name": "Cafetaria Dunant", + "address": "Henri Dunantlaan 2", + "latitude": 51.049023, + "longitude": 3.704017, + "type": "cafetaria", + "open": {} + } + ] }