import { fetchJobs, isEnglishContent } from "../fetch.ts"; import type { SearchConfig } from "../config.ts"; const searches: SearchConfig[] = [ { label: "Web Developer Switzerland (onsite/hybrid)", keywords: "Web Developer OR Full Stack Developer OR Frontend Developer OR Backend Developer", location: "Switzerland", workType: ["onsite", "hybrid"], timePosted: "month" }, { label: "Web Developer Switzerland (remote)", keywords: "Web Developer OR Full Stack Developer OR Frontend Developer OR Backend Developer", location: "Switzerland", workType: ["remote"], timePosted: "month" }, ]; const seen = new Set(); const results: { title: string; company: string; location: string; link: string; search: string }[] = []; for (const config of searches) { console.log(`\n[${config.label}]`); const jobs = await fetchJobs(config); for (const job of jobs) { if (seen.has(job.id)) continue; seen.add(job.id); process.stdout.write(` ${job.title} @ ${job.company} … `); const ok = await isEnglishContent(job.id); if (!ok) { console.log("dropped"); continue; } console.log("ok"); results.push({ ...job, search: config.label }); } } console.log(`\n=== ${results.length} web developer jobs ===\n`); for (const j of results) { console.log(`${j.title} | ${j.company} | ${j.location} | ${j.link}`); }