Skip to content

Commit

Permalink
Parse german and english building links (fixes #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
blu3r4y committed Jan 10, 2022
1 parent 1c7f802 commit f56f6b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scraper/components/buildings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export class BuildingScraper extends ScraperComponent<BuildingScrape[]> {
const buildings: BuildingScrape[] = values
.get()
.map((t: { header: string; href: string | undefined }) => {
// check for a link to '/buildings/' and not some other site
if (!t.href || !t.href.includes("/buildings/")) return null;
// check for a link to buildings and not some other site
if (!t.href) return null;
if (!t.href.includes("/buildings/") && !t.href.includes("/gebaeude/"))
return null;

return {
// remove whitespace and leading numbers from the name
Expand Down

0 comments on commit f56f6b3

Please sign in to comment.