diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..18e4b4c --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +######################################## +# Add your LinkedIn credentials here # +######################################## +EMAIL= +PASSWORD= diff --git a/config.json b/config.json index 0df5ca4..80a4951 100644 --- a/config.json +++ b/config.json @@ -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" + ] } diff --git a/index.js b/index.js index 833f29c..77051a7 100644 --- a/index.js +++ b/index.js @@ -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"); @@ -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"); } });