Class KITMensaScraper
java.lang.Object
edu.kit.aifb.atks.mensascraper.lib.KITMensaScraper
A scraper to fetch the meal menu for Studierendenwerk Karlsruhe canteens.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate new default scraper instance.KITMensaScraper
(boolean noCache) Create new scraper instance and control caching behavior. -
Method Summary
Modifier and TypeMethodDescriptionfetchMeals
(MensaLocation location, LocalDate day) Fetch list of meals for a given canteen and given day.
-
Constructor Details
-
KITMensaScraper
public KITMensaScraper()Create new default scraper instance. -
KITMensaScraper
public KITMensaScraper(boolean noCache) Create new scraper instance and control caching behavior.- Parameters:
noCache
- Whether to cache per-day meal menus. Iftrue
, requesting meals for same canteen and same day will only result in one fetch operation.
-
-
Method Details
-
fetchMeals
Fetch list of meals for a given canteen and given day. Currently, only "Mensa am Adenauerring" is supported. Note that you cannot request data for past days.- Parameters:
location
- Which canteen (aka. Mensa) to request meals for.day
- Which date to request meals for. Must be larger or equal than today (LocalDate.now()
). Usually, only data for the upcoming 5 weeks is available.- Returns:
- List of meals or empty list if no data is available.
- Throws:
MensaScraperException
- Thrown if requested date is invalid or if anything else went wrong while downloading and parsing the menu.
-