Files
rodado b4957025b1 chore: update search scripts, extra sources and post drafts
Adds the one-off scripts accumulated across recent sessions, removes
temp scripts whose searches now live in config.ts as role-family
sweeps, and updates fetch-other.ts plus the LinkedIn post drafts.
2026-08-27 09:03:05 +02:00

63 lines
1.6 KiB
TypeScript

import { KEYWORDS } from "../config.ts";
import type { SearchConfig } from "../config.ts";
import { fetchJobs, isEnglishContent } from "../fetch.ts";
import { readFileSync } from "fs";
const csv = readFileSync("./results/jobs.csv", "utf8");
const existingIds = new Set(
[...csv.matchAll(/jobs\/view\/(\d+)\//g)].map((m) => m[1])
);
const searches: SearchConfig[] = [
{
label: "Zürich (city)",
keywords: KEYWORDS,
geoId: "102436504",
location: "Zürich, Switzerland",
workType: ["onsite", "hybrid"],
timePosted: "month",
},
{
label: "Zürich Metropolitan Area",
keywords: KEYWORDS,
geoId: "107814425",
location: "Zürich Metropolitan Area",
workType: ["onsite", "hybrid"],
timePosted: "month",
},
{
label: "Zürich Area",
keywords: KEYWORDS,
geoId: "90009888",
location: "Zürich Area",
workType: ["onsite", "hybrid"],
timePosted: "month",
},
];
const seen = new Set<string>();
const allJobs = [];
for (const cfg of searches) {
const jobs = await fetchJobs(cfg);
for (const j of jobs) {
if (seen.has(j.id) || existingIds.has(j.id)) continue;
seen.add(j.id);
allJobs.push(j);
}
}
console.log(`\n${allJobs.length} new Zürich jobs. Checking English content…\n`);
const results = [];
for (const j of allJobs) {
process.stdout.write(` ${j.title} — ${j.company} … `);
const ok = await isEnglishContent(j.id);
console.log(ok ? "ok" : "dropped (non-English)");
if (ok) results.push(j);
}
console.log(`\n=== ${results.length} new English Zürich jobs ===\n`);
for (const j of results) {
console.log(`${j.title} | ${j.company} | ${j.link}`);
}