Using Puppeteer and PixelMatch to monitor websites

An update is commented out after testing
const time = Date.now();
const imagePath = `images/${query.id}-${time}.png` // 'images/1-123.jpg'
const diffImagePath = `images/${query.id}-diff-${time}.png`
const newImage = PNG.sync.read(fs.readFileSync(`../public/${imagePath}`))
await fetch('https://api.emailjs.com/api/v1.0/email/send', {method: 'POST',body: JSON.stringify(emailData),headers: { 'Content-Type': 'application/json' },}).then(res => {console.log('success emailing to ', query.User.email)}).catch(err => {console.log('error emailing', err)})

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store