From f297e1d7d3d03ab57e2e5c4dcf150f0d44ed750d Mon Sep 17 00:00:00 2001 From: Alex Pantechovskis Date: Thu, 14 Oct 2021 00:58:08 +0300 Subject: [PATCH] feat(coolmod): add linksBuilder and update selectors (#2803) --- src/store/model/coolmod.ts | 491 ++++--------------------------------- 1 file changed, 45 insertions(+), 446 deletions(-) diff --git a/src/store/model/coolmod.ts b/src/store/model/coolmod.ts index b17d12789f..6e581c7494 100644 --- a/src/store/model/coolmod.ts +++ b/src/store/model/coolmod.ts @@ -1,19 +1,20 @@ import {Store} from './store'; +import {getProductLinksBuilder} from './helpers/card'; export const Coolmod: Store = { currency: '€', labels: { inStock: { - container: '.product-availability', - text: ['Envío'], + container: '#productBuyButtons', + text: ['COMPRAR'], }, maxPrice: { - container: '.text-price-total', + container: '#normalpricenumber', euroFormat: true, }, outOfStock: { - container: '.product-availability', - text: ['Sin Stock'], + container: '#productBuyButtons', + text: ['NO DISPONIBLE'], }, }, links: [ @@ -23,387 +24,6 @@ export const Coolmod: Store = { series: 'test:series', url: 'https://www.coolmod.com/kfa2-geforce-rtx-2060-super-1-click-oc-8gb-gddr6-tarjeta-grafica-precio', }, - // 3090 - { - brand: 'asus', - model: 'strix oc white', - series: '3090', - url: 'https://www.coolmod.com/asus-rog-strix-geforce-rtx-3090-oc-white-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3 ultra', - series: '3090', - url: 'https://www.coolmod.com/evga-geforce-rtx-3090-xc3-ultra-gaming-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3', - series: '3090', - url: 'https://www.coolmod.com/evga-geforce-rtx-3090-xc3-gaming-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3 black', - series: '3090', - url: 'https://www.coolmod.com/evga-geforce-rtx-3090-xc3-black-gaming-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus xtreme waterforce', - series: '3090', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3090-xtreme-waterforce-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus master', - series: '3090', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3090-master-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus xtreme', - series: '3090', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3090-xtrem-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'ichill x4', - series: '3090', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3090-ichill-x4-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'hof', - series: '3090', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3090-hof-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'hof premium', - series: '3090', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3090-hof-premium-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'hof limited edition', - series: '3090', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3090-hof-limited-edition-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'msi', - model: 'suprim x', - series: '3090', - url: 'https://www.coolmod.com/msi-geforce-rtx-3090-suprim-x-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'pny', - model: 'xlr8 uprising', - series: '3090', - url: 'https://www.coolmod.com/pny-geforce-rtx-3090-xlr8-gaming-epic-x-rgb-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'pny', - model: 'xlr8 revel', - series: '3090', - url: 'https://www.coolmod.com/pny-geforce-rtx-3090-xlr8-gaming-epic-x-rgb-24gb-gddr6x-tarjeta-grafica_76404-precio', - }, - { - brand: 'zotac', - model: 'trinity oc', - series: '3090', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3090-trinity-oc-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'amp holo', - series: '3090', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3090-amp-core-holo-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'articstorm', - series: '3090', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3090-arcticstorm-24gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'trinity', - series: '3090', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3090-trinity-24gb-gddr6x-tarjeta-grafica-precio', - }, - // 3080ti - { - brand: 'asus', - model: 'strix', - series: '3080ti', - url: 'https://www.coolmod.com/asus-rog-strix-geforce-rtx-3080-ti-gaming-oc-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3 black', - series: '3080ti', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-ti-xc3-black-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3', - series: '3080ti', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-ti-xc3-gaming-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'ftw3', - series: '3080ti', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-ti-ftw3-gaming-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'ftw3 ultra', - series: '3080ti', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-ti-ftw3-ultra-gaming-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'gaming oc', - series: '3080ti', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3080-ti-gaming-oc-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'vision oc', - series: '3080ti', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3080-ti-vision-oc-12gb-gddr6x-tarjeta-grafica_81994-precio', - }, - { - brand: 'gigabyte', - model: 'eagle oc', - series: '3080ti', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3080-ti-eagle-oc-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus xtreme', - series: '3080ti', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3080-ti-xtreme-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'ichill x4', - series: '3080ti', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ti-ichill-x4-12gb-gddr6x-tarjeta-grafica_81785-precio', - }, - { - brand: 'inno3d', - model: 'x3 oc', - series: '3080ti', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ti-x3-oc-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'ichill frostbite', - series: '3080ti', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ti-ichill-frostbite-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'x3', - series: '3080ti', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ti-x3-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'ichill x3', - series: '3080ti', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ti-ichill-x3-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'sg', - series: '3080ti', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3080-ti-sg-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'sg oc', - series: '3080ti', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3080-ti-exg-1-click-oc-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'msi', - model: 'gaming x trio', - series: '3080ti', - url: 'https://www.coolmod.com/msi-geforce-rtx-3080-ti-gaming-x-trio-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'pny', - model: 'xlr8 uprising', - series: '3080ti', - url: 'https://www.coolmod.com/pny-geforce-rtx-3080-ti-xlr8-gaming-uprising-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'palit', - model: 'gaming pro', - series: '3080ti', - url: 'https://www.coolmod.com/palit-geforce-rtx-3080-ti-gamingpro-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'trinity', - series: '3080ti', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3080-ti-trinity-triple-fan-12gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'amp holo', - series: '3080ti', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3080-ti-trinity-amp-holo-12gb-gddr6x-tarjeta-grafica-precio', - }, - // 3080 - { - brand: 'gigabyte', - model: 'eagle oc', - series: '3080', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3080-eagle-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'msi', - model: 'ventus 3x oc', - series: '3080', - url: 'https://www.coolmod.com/msi-geforce-rtx-3080-ventus-3x-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'asus', - model: 'tuf', - series: '3080', - url: 'https://www.coolmod.com/asus-geforce-tuf-rtx-3080-gaming-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'gaming oc', - series: '3080', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3080-gaming-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'msi', - model: 'gaming x trio', - series: '3080', - url: 'https://www.coolmod.com/msi-geforce-rtx-3080-gaming-x-trio-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'asus', - model: 'tuf oc', - series: '3080', - url: 'https://www.coolmod.com/asus-geforce-tuf-rtx-3080-oc-gaming-10gb-gddr6x-tarjeta-grfica-precio', - }, - { - brand: 'asus', - model: 'strix oc', - series: '3080', - url: 'https://www.coolmod.com/asus-rog-strix-geforce-rtx-3080-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3 black', - series: '3080', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-xc3-black-gaming-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'trinity', - series: '3080', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3080-trinity-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3 ultra', - series: '3080', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-xc3-ultra-gaming-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'asus', - model: 'strix', - series: '3080', - url: 'https://www.coolmod.com/asus-rog-strix-geforce-rtx-3080-10gb-gddr6x-tarjeta-grfica-precio', - }, - { - brand: 'zotac', - model: 'trinity oc', - series: '3080', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3080-trinity-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'vision oc', - series: '3080', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3080-vision-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3', - series: '3080', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-xc3-gaming-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'ftw3 ultra', - series: '3080', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-ftw3-ultra-gaming-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus master', - series: '3080', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3080-master-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus xtreme', - series: '3080', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3080-xtreme-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'ftw3', - series: '3080', - url: 'https://www.coolmod.com/evga-geforce-rtx-3080-ftw3-gaming-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'pny', - model: 'xlr8 revel', - series: '3080', - url: 'https://www.coolmod.com/pny-geforce-rtx-3080-10gb-xlr8-gaming-epic-x-rgb-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'pny', - model: 'xlr8 revel', - series: '3080', - url: 'https://www.coolmod.com/pny-geforce-rtx-3080-xlr8-gaming-epic-x-rgb-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'sg oc', - series: '3080', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3080-sg-1-click-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'ichill x4', - series: '3080', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ichill-x4-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'ichill x3', - series: '3080', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-ichill-x3-10gb-gddr6x-tarjeta-grafica-precio', - }, - { - brand: 'inno3d', - model: 'twin x2 oc', - series: '3080', - url: 'https://www.coolmod.com/inno3d-geforce-rtx-3080-twin-x2-oc-10gb-gddr6x-tarjeta-grafica-precio', - }, { brand: 'amd', model: '5600x', @@ -428,66 +48,45 @@ export const Coolmod: Store = { series: 'ryzen5950', url: 'https://www.coolmod.com/amd-ryzen-9-5950x-49ghz-socket-am4-boxed-procesador-precio', }, - { - brand: 'asus', - model: 'dual', - series: '3070', - url: 'https://www.coolmod.com/asus-dual-geforce-rtx-3070-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'msi', - model: 'gaming x trio', - series: '3070', - url: 'https://www.coolmod.com/msi-geforce-rtx-3070-gaming-x-trio-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'msi', - model: 'ventus 2x', - series: '3070', - url: 'https://www.coolmod.com/msi-geforce-rtx-3070-ventus-2x-oc-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'evga', - model: 'xc3', - series: '3070', - url: 'https://www.coolmod.com/evga-geforce-rtx-3070-xc3-black-gaming-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'asus', - model: 'strix', - series: '3070', - url: 'https://www.coolmod.com/asus-rog-strix-geforce-rtx-3070-gaming-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'eagle', - series: '3070', - url: 'https://www.coolmod.com/gigabyte-geforce-rtx-3070-eagle-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'gigabyte', - model: 'aorus master', - series: '3070', - url: 'https://www.coolmod.com/gigabyte-aorus-geforce-rtx-3070-master-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'pny', - model: 'xlr8 revel', - series: '3070', - url: 'https://www.coolmod.com/pny-geforce-rtx-3070-xlr8-gaming-epic-x-rgb-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'zotac', - model: 'twin edge', - series: '3070', - url: 'https://www.coolmod.com/zotac-gaming-geforce-rtx-3070-twin-edge-8gb-gddr6-tarjeta-grafica-precio', - }, - { - brand: 'kfa2', - model: 'sg oc', - series: '3070', - url: 'https://www.coolmod.com/kfa2-geforce-rtx-3070-sg-1-click-oc-8gb-gddr6-tarjeta-grafica-precio', - }, ], name: 'coolmod', + linksBuilder: { + builder: getProductLinksBuilder({ + productsSelector: '.productInfo.itemFiltered', + sitePrefix: 'https://www.coolmod.com/', + titleSelector: '.productName a', + }), + ttl: 1, + waitForSelector: '.productInfo.itemFiltered', + urls: [ + { + series: '3060', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/9678', + }, + { + series: '3060ti', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/9674', + }, + { + series: '3070', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/9675', + }, + { + series: '3070ti', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/9727', + }, + { + series: '3080', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/9676', + }, + { + series: '3080ti', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/9728', + }, + { + series: '3090', + url: 'https://www.coolmod.com/tarjetas-graficas/appliedfilters/8557', + }, + ], + }, };