fix: parse minimally-quoted csv rows when loading jobs.csv
This commit is contained in:
@@ -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] ?? "" };
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user