Skip to content

Commit

Permalink
Detect lecture halls more robustly (fixes #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
blu3r4y committed Jan 10, 2022
1 parent f56f6b3 commit 1de8692
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scraper/components/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ export class JkuRoomScraper extends ScraperComponent<RoomScrape[]> {
if (tds.length === 3) {
// if this is a lecture hall (HS), abbreviate them
const description = tds.eq(0).text();
const match = description.match(/(HS \d+)/);
const hsRegex = /(?:HS|Hörsaal|Lecture Hall) (\d+)/;
const match = description.match(hsRegex);

return {
name: match == null ? tds.eq(1).text() : match[1],
name: match ? `HS ${match[1]}` : tds.eq(1).text(),
capacity: tds.eq(2).text(),
};
}
Expand Down

0 comments on commit 1de8692

Please sign in to comment.