<aside> 🔗 https://github.com/AdamManuel-dev/LinkedInNotifications
</aside>
In the fast-paced world of job hunting, staying ahead of the competition means being the first to know about new opportunities. With the power of automation, you can have a system that scrapes LinkedIn for job postings and notifies you in real-time. This blog post dives into a JavaScript script using Puppeteer, Node-Notifier, and Node-Cron to make your job search more efficient.
The script integrates several key components:
The script begins by reading configurations from a CSV file, searches.csv, which contains search terms, intervals, and LinkedIn URLs:
javascriptCopy code
const configCSV = fs.readFileSync('./searches.csv', {
encoding: 'utf-8',
})
const configArr = configCSV.split('\n').map((line) => line.split(','));
configArr.shift()
const input = configArr.filter((x) => x.length === 3).map(([title, minuteLapse, url]) => ({
url,
title,
minuteLapse: Number.parseInt(minuteLapse)
}))
This code reads the CSV file, splits it into lines, and maps each line to an object containing the job title, time interval, and LinkedIn search URL.
To avoid notifying about the same job postings multiple times, the script reads a cache file that stores previously seen URLs:
javascriptCopy code
const _cachedUrls = fs.readFileSync('./cache', {
encoding: 'utf-8',
})
const cachedUrls = ((_cachedUrls.includes('\n')) ? _cachedUrls.split('\n') : []).filter((x) => x.length !== 0)
The main function grabLinks uses Puppeteer to navigate to LinkedIn search pages, scrape job posting links, and filter out those already seen: