Skip to content

Commit

Permalink
Fix logic for skipping certain job titles
Browse files Browse the repository at this point in the history
  • Loading branch information
chunkingz committed Oct 30, 2024
1 parent 28fb7c5 commit 9728302
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 34 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
########################################
# Add your LinkedIn credentials here #
########################################
EMAIL=
PASSWORD=
66 changes: 38 additions & 28 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
{
"browserPath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"keyword": [
"\"Full Stack Engineer\"",
"\"fullstack developer\"",
"\"full stack developer\"",
"\"javascript developer\"",
"\"nodejs developer\"",
"\"java developer\""
],
"location": "United States",
"periodOfTime": "Past 24 hours",
"AvgExperience": 2,
"resolution": "--window-size=1400,900",
"baseURL": "https://www.linkedin.com/login",
"numberOfPagination": 14,
"numberOfOffersPerPage": 25,
"avoidJobTitles": [
"Test",
"PYTHON",
"PRINCIPAL",
"STAFF",
"MANAGER",
"ANGULAR",".NET","C#",
"SHAREPOINT", "SHARE POINT",
"LEAD", "ARCHITECT", "CLEARANCE",
"USC","GC","SECRET","TOP","NET",
"LOCAL","CITIZEN"
]
"browserPath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"keyword": [
"\"Full Stack Engineer\"",
"\"fullstack developer\"",
"\"full stack developer\"",
"\"javascript developer\"",
"\"nodejs developer\"",
"\"java developer\""
],
"location": "United States",
"periodOfTime": "Past 24 hours",
"AvgExperience": 2,
"resolution": "--window-size=1400,900",
"baseURL": "https://www.linkedin.com/login",
"numberOfPagination": 14,
"numberOfOffersPerPage": 25,
"avoidJobTitles": [
"Test",
"PYTHON",
"PRINCIPAL",
"STAFF",
"MANAGER",
"ANGULAR",
".NET",
"C#",
"SHAREPOINT",
"SHARE POINT",
"LEAD",
"ARCHITECT",
"CLEARANCE",
"USC",
"GC",
"SECRET",
"TOP",
"NET",
"LOCAL",
"CITIZEN"
]
}
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,15 @@ async function FillAndApply() {
console.log("jobLink: " + jobLink);

// Check if the job title is in the list of titles to avoid
if (avoidJobTitles.includes(jobTitle)) {
const jobTitleRegex = new RegExp(
`\\b(${avoidJobTitles.join("|")})\\b`,
"i"
);
if (jobTitleRegex.test(jobTitle)) {
console.log(`Skipping job with title: ${jobTitle}`);
// await Scrolling();
continue; // Skip this job and continue to the next one
}
console.log("Applying....");
console.log(`Applying to ${jobTitle} ...`);

// Click the "Easy Apply" button
await clickElement("[class*=jobs-apply-button]>button");
Expand All @@ -241,10 +244,7 @@ async function FillAndApply() {
'div[class="artdeco-modal__actionbar ember-view job-trust-pre-apply-safety-tips-modal__footer"]>button+div>div>button'
);
if (continueApplyingButton != null) {
console.log("Job search safety reminder dialog found");
continueApplyingButton.click(); // Click the "Continue applying" button in the "Job search safety reminder" dialog
} else {
console.log("Continue as expected");
}
});

Expand Down

0 comments on commit 9728302

Please sign in to comment.