diff --git a/db-datos/supermercado.ts b/db-datos/supermercado.ts index 1073db6..1e167a0 100644 --- a/db-datos/supermercado.ts +++ b/db-datos/supermercado.ts @@ -4,7 +4,12 @@ export enum Supermercado { Coto = "Coto", Jumbo = "Jumbo", } - +export const supermercados: Supermercado[] = [ + Supermercado.Carrefour, + Supermercado.Coto, + Supermercado.Dia, + Supermercado.Jumbo, +]; export const hosts: { [host: string]: Supermercado } = { "diaonline.supermercadosdia.com.ar": Supermercado.Dia, "www.carrefour.com.ar": Supermercado.Carrefour, diff --git a/scraper/auto.ts b/scraper/auto.ts index 774fea4..482e774 100644 --- a/scraper/auto.ts +++ b/scraper/auto.ts @@ -1,7 +1,7 @@ import { mkdtemp, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { Supermercado, hosts } from "db-datos/supermercado.js"; +import { Supermercado, hosts, supermercados } from "db-datos/supermercado.js"; import PQueue from "p-queue"; import { formatDuration, intervalToDuration } from "date-fns"; import { downloadList } from "./scrap.js"; @@ -13,12 +13,6 @@ import { scrapCotoProducts } from "../link-scrapers/coto.js"; import { scrapCarrefourProducts } from "../link-scrapers/carrefour.js"; import { scrapJumboProducts } from "../link-scrapers/jumbo.js"; -const supermercados: Supermercado[] = [ - Supermercado.Carrefour, - Supermercado.Coto, - Supermercado.Dia, -]; - // hacemos una cola para el scrapeo para no tener varios writers a la BD y no sobrecargar la CPU const scrapQueue = new PQueue({ concurrency: 4 });