fix: parse minimally-quoted csv rows when loading jobs.csv

This commit is contained in:
2026-10-06 15:17:16 +02:00
parent 74f8df0b15
commit 01dd3861b6
3 changed files with 27 additions and 2 deletions
+2 -1
View File
@@ -5,6 +5,7 @@
// bun daily --resend skip fetching, re-send today's jobs from the CSV
import { send, escapeHtml } from "./telegram.ts";
import { matchesProfile } from "./profile.ts";
import { parseCsvLine } from "./csv.ts";
const CSV = "./results/jobs.csv";
const SENT = "./results/sent.txt"; // links already pushed — never resend
@@ -20,7 +21,7 @@ function parse(text: string): Row[] {
.slice(1)
.filter(Boolean)
.map((l) => {
const c = l.replace(/^"|"$/g, "").split('","');
const c = parseCsvLine(l);
return { fetched: c[0], posted: c[1], search: c[2], title: c[3], company: c[4], link: c[5], source: c[6], location: c[7] ?? "" };
});
}