add more options and keywords

This commit is contained in:
ilia 2025-07-02 13:07:15 -04:00
parent 0bae970ff0
commit 8bcb537265
3 changed files with 11 additions and 6 deletions

2
keywords-open-work.csv Normal file
View File

@ -0,0 +1,2 @@
keyword
fired
1 keyword
2 fired

View File

@ -37,10 +37,10 @@ const path = require("path");
require("dotenv").config();
const csv = require("csv-parser");
const DATE_POSTED = "past-week"; // "past-24h", "past-week", "past-month", or ""
const SORT_BY = "date_posted"; // "relevance", "date_posted"
const WHEELS = 5;
const CITY = "Toronto";
const DATE_POSTED = process.env.DATE_POSTED || "past-week"; // "past-24h", "past-week", "past-month", or ""
const SORT_BY = process.env.SORT_BY || "date_posted"; // "relevance", "date_posted"
const WHEELS = process.env.WHEELS || 5;
const CITY = process.env.CITY || "Toronto";
// Read credentials and headless mode from .env
const LINKEDIN_USERNAME = process.env.LINKEDIN_USERNAME;
@ -97,7 +97,10 @@ function containsAnyKeyword(text, keywords) {
// Read keywords from CSV
const keywords = [];
const csvPath = path.join(process.cwd(), "keywords.csv");
const csvPath = path.join(
process.cwd(),
process.env.KEYWORDS || "keywords-layoff.csv"
);
fs.createReadStream(csvPath)
.pipe(csv())
@ -106,7 +109,7 @@ fs.createReadStream(csvPath)
})
.on("end", async () => {
if (keywords.length === 0) {
console.error("No keywords found in keywords.csv");
console.error("No keywords found in csv");
process.exit(1);
}