Update index.js

This commit is contained in:
nguyentrungthat 2025-11-20 10:22:56 +07:00
parent e560368120
commit 942c9d18c4
1 changed files with 34 additions and 2 deletions

View File

@ -6,10 +6,42 @@ import nodemailer from "nodemailer";
import dayjs from "dayjs"; import dayjs from "dayjs";
import mysql from "mysql2/promise"; import mysql from "mysql2/promise";
const EMAILS = ["andrew.ng@apactech.io", "dev@apactech.io"]; const EMAILS = ["andrew.ng@apactech.io", "dev@apactech.io", "ips@ipsupply.com.au", "kay@ipsupply.com.au", "victor@ipsupply.com.au"];
// const EMAILS = ["andrew.ng@apactech.io"]; // const EMAILS = ["andrew.ng@apactech.io"];
const LIST_STORE = [ const LIST_STORE = [
{
name: "ithardwarebroker",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=ithardwarebroker&store_name=ithardwarebroker&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "xsnetworktech",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=xsnetworktechau&store_name=xsnetworktech&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "superitspares",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=cashforexcessitequipment&store_name=superitspares&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "core4solutionsithardwarestore",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=core4solutions&store_name=core4solutionsithardwarestore&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "technologylockerptyltd",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=technologylockerptyltd&store_name=technologylockerptyltd&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "pclanptyltd",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=pclan_online&store_name=pclanptyltd&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "networkbrokerscall0285683703",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=network-brokers-international&store_name=networkbrokerscall0285683703&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{
name: "dedicatednetworksinc",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=dedicatednetwork&store_name=dedicatednetworksinc&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
},
{ {
name: "ocdepot", name: "ocdepot",
url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=ocdepot&store_name=ocdepot&_oac=1&LH_Sold=1&rt=nc&_ipg=240", url: "https://www.ebay.com/sch/i.html?_dkr=1&iconV2Request=true&_blrs=recall_filtering&_ssn=ocdepot&store_name=ocdepot&_oac=1&LH_Sold=1&rt=nc&_ipg=240",
@ -267,7 +299,7 @@ async function main() {
inserted.push({ name: store.name, count }); inserted.push({ name: store.name, count });
} }
if (errors.length > 3) { if (errors.length > 11) {
const msg = errors.map((e) => `URL: ${e.url}\nMessage: ${e.message}`).join("\n\n"); const msg = errors.map((e) => `URL: ${e.url}\nMessage: ${e.message}`).join("\n\n");
await sendMail("[Sold out] - Scraping Sold Out Error Report", msg); await sendMail("[Sold out] - Scraping Sold Out Error Report", msg);
} else { } else {