1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { scrapeSAGA } from "https://esm.town/v/matthiasraimann/SagaImmoScraper";
import { email } from "https://esm.town/v/std/email";
export async function main() {
const areas: Area[] = [
{
center: "Petkumstraße 26, 22085 Hamburg",
meters: 6_000,
},
{
center: "Große Bergstraße 252, 22767 Hamburg",
meters: 4_000,
},
];
try {
const immos = await scrapeSAGA(areas, 600, 50);
email({
subject: "Neue Immobilien durch Valtown",
text: immos.map(i => i.renderImmo()).join("\n\n"),
});
console.log(`found immo (${immos.length}):\n\n` + immos.map(i => i.renderImmo().join("\n\n")));
} catch (e) {
console.log("nothing found");
}
}
export type Area = { center: string; meters: number };
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
July 16, 2024