26 lines
1000 B
JavaScript
26 lines
1000 B
JavaScript
require("dotenv").config();
|
|
|
|
const bikegear = require("../src/business-logic/import-pipeline/sources/bikegear");
|
|
|
|
async function main() {
|
|
process.env.BIKEGEAR_CACHE_ONLY = "false";
|
|
process.env.BIKEGEAR_CACHE_HOURS = "0";
|
|
process.env.BIKEGEAR_FETCH_MODE = process.env.BIKEGEAR_FETCH_MODE || "browser";
|
|
process.env.BIKEGEAR_REQUEST_DELAY = process.env.BIKEGEAR_REQUEST_DELAY || "5000";
|
|
|
|
const runPaths = bikegear.paths();
|
|
console.log("[BIKEGEAR-CACHE] Starting BikeGear scrape-only run.");
|
|
console.log(`[BIKEGEAR-CACHE] Output: ${runPaths.aggregatedJson}`);
|
|
|
|
const summary = await bikegear.fetchWebsiteData({ paths: runPaths });
|
|
const total = summary?.analysis?.totalProductsUnique ?? summary?.analysis?.detailSuccess ?? 0;
|
|
|
|
console.log(`[BIKEGEAR-CACHE] Done. Cached products: ${total}`);
|
|
console.log(`[BIKEGEAR-CACHE] File ready: ${summary.outputJsonPath}`);
|
|
}
|
|
|
|
main().catch((error) => {
|
|
process.exitCode = 1;
|
|
console.error(`[BIKEGEAR-CACHE] Failed: ${error.message}`);
|
|
});
|