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.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { KEYWORDS } from "../config.ts";
|
||||
import { fetchJobs, isEnglishContent } from "../fetch.ts";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
// Load existing IDs from CSV
|
||||
const csv = readFileSync("./results/jobs.csv", "utf8");
|
||||
const existingIds = new Set(
|
||||
[...csv.matchAll(/jobs\/view\/(\d+)\//g)].map((m) => m[1])
|
||||
);
|
||||
|
||||
const jobs = await fetchJobs({
|
||||
label: "CH Remote",
|
||||
keywords: KEYWORDS,
|
||||
location: "Switzerland",
|
||||
workType: ["remote"],
|
||||
timePosted: "month",
|
||||
});
|
||||
|
||||
const newJobs = jobs.filter((j) => !existingIds.has(j.id));
|
||||
console.log(`\n${newJobs.length} new remote CH jobs. Checking English content…\n`);
|
||||
|
||||
const results = [];
|
||||
for (const j of newJobs) {
|
||||
process.stdout.write(` ${j.title} … `);
|
||||
const ok = await isEnglishContent(j.id);
|
||||
console.log(ok ? "ok" : "dropped (non-English)");
|
||||
if (ok) results.push(j);
|
||||
}
|
||||
|
||||
console.log(`\n${results.length} vagas remotas novas na Suíça\n`);
|
||||
for (const j of results) {
|
||||
console.log(`${j.title} — ${j.company}`);
|
||||
console.log(` ${j.link}`);
|
||||
}
|
||||
Reference in New Issue
Block a user