async function main() {

    // keep track of how long our app takes to run
    console.time('executionTime');

    // here's our headless browser
    const browser = await puppet.launch();

    // all the retailers we want to check
    const target = await browser.newPage();
    const amazon = await browser.newPage();
    const psDirect = await browser.newPage();

    // check the sites for each retailer
    let targetRes = await checkRoutine.checkSite(target, c.websites.target, c.patterns.target);
    let amazonRes = await checkRoutine.checkSite(amazon, c.websites.amazon, c.patterns.amazon);
    let psDirectRes = await checkRoutine.checkSite(psDirect, c.websites.psDirect, c.patterns.psDirect);

    // if we have a result send a message to yourself with the URL of the available ps5
    var results = [targetRes, amazonRes, psDirectRes]
    for (let res of results) {
        if (res == true) {
            exec(`node sendSMS.js ${res}`); // send yourself a message with the available URL
        }
    }
    // kill puppet
    await browser.close();

    // console log runtime
    let ct = countSites()
    console.log(`CHECKED ${ct} WEBSITES IN:`);
    console.timeEnd('executionTime');

    // kill app
    process.exit();
}
/**
 * Root of our app. Call to run.
 */
Root of our app. Call to run.
Root of our app . Call to run .
async function main() {
    console.time('executionTime');
    const browser = await puppet.launch();
    const target = await browser.newPage();
    const amazon = await browser.newPage();
    const psDirect = await browser.newPage();
    let targetRes = await checkRoutine.checkSite(target, c.websites.target, c.patterns.target);
    let amazonRes = await checkRoutine.checkSite(amazon, c.websites.amazon, c.patterns.amazon);
    let psDirectRes = await checkRoutine.checkSite(psDirect, c.websites.psDirect, c.patterns.psDirect);
    var results = [targetRes, amazonRes, psDirectRes]
    for (let res of results) {
        if (res == true) {
            exec(`node sendSMS.js ${res}`); 
        }
    }
    await browser.close();
    let ct = countSites()
    console.log(`CHECKED ${ct} WEBSITES IN:`);
    console.timeEnd('executionTime');
    process.exit();
}
async function main ( ) { console . time ( 'executionTime' ) ; const browser = await puppet . launch ( ) ; const target = await browser . newPage ( ) ; const amazon = await browser . newPage ( ) ; const psDirect = await browser . newPage ( ) ; let targetRes = await checkRoutine . checkSite ( target , c . websites . target , c . patterns . target ) ; let amazonRes = await checkRoutine . checkSite ( amazon , c . websites . amazon , c . patterns . amazon ) ; let psDirectRes = await checkRoutine . checkSite ( psDirect , c . websites . psDirect , c . patterns . psDirect ) ; var results = [ targetRes , amazonRes , psDirectRes ] for ( let res of results ) { if ( res == true ) { exec ( ` ${ res } ` ) ; } } await browser . close ( ) ; let ct = countSites ( ) console . log ( ` ${ ct } ` ) ; console . timeEnd ( 'executionTime' ) ; process . exit ( ) ; }
Root of our app.
Root of our app .
// keep track of how long our app takes to run // here's our headless browser // all the retailers we want to check // check the sites for each retailer // if we have a result send a message to yourself with the URL of the available ps5 // send yourself a message with the available URL // kill puppet // console log runtime // kill app