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 };