From cccfde245affc11506c69d1ef6c30c09953307d4 Mon Sep 17 00:00:00 2001 From: sohaiiil <75142231+sohaiiil@users.noreply.github.com> Date: Sat, 12 Dec 2020 14:01:54 +0000 Subject: [PATCH] feat(discord): dynamic currency symbol (#1328) --- src/__test__/notification-test.ts | 1 + src/notification/discord.ts | 7 ++++++- src/notification/notification.ts | 4 ++-- src/store/model/adorama.ts | 1 + src/store/model/alternate-nl.ts | 1 + src/store/model/alternate.ts | 1 + src/store/model/amazon-ca.ts | 1 + src/store/model/amazon-de-warehouse.ts | 1 + src/store/model/amazon-de.ts | 1 + src/store/model/amazon-es.ts | 1 + src/store/model/amazon-fr.ts | 1 + src/store/model/amazon-it.ts | 1 + src/store/model/amazon-nl.ts | 1 + src/store/model/amazon-uk.ts | 1 + src/store/model/amazon.ts | 1 + src/store/model/amd-ca.ts | 1 + src/store/model/amd-de.ts | 1 + src/store/model/amd-it.ts | 1 + src/store/model/amd.ts | 1 + src/store/model/antonline.ts | 1 + src/store/model/argos.ts | 1 + src/store/model/aria.ts | 1 + src/store/model/arlt.ts | 1 + src/store/model/asus-de.ts | 1 + src/store/model/asus.ts | 1 + src/store/model/awd.ts | 1 + src/store/model/azerty.ts | 1 + src/store/model/bandh.ts | 1 + src/store/model/bestbuy-ca.ts | 1 + src/store/model/bestbuy.ts | 1 + src/store/model/box.ts | 1 + src/store/model/canadacomputers.ts | 1 + src/store/model/caseking.ts | 1 + src/store/model/ccl.ts | 1 + src/store/model/comet.ts | 1 + src/store/model/computeruniverse.ts | 1 + src/store/model/coolblue.ts | 1 + src/store/model/coolmod.ts | 1 + src/store/model/corsair.ts | 1 + src/store/model/currys.ts | 1 + src/store/model/cyberport.ts | 1 + src/store/model/ebgames.ts | 1 + src/store/model/ebuyer.ts | 3 ++- src/store/model/elcorteingles.ts | 1 + src/store/model/eprice.ts | 1 + src/store/model/euronics-de.ts | 1 + src/store/model/euronics.ts | 1 + src/store/model/evga-eu.ts | 1 + src/store/model/evga.ts | 1 + src/store/model/expert.ts | 1 + src/store/model/galaxus.ts | 1 + src/store/model/game.ts | 1 + src/store/model/gamestop-de.ts | 1 + src/store/model/gamestop.ts | 1 + src/store/model/kabum.ts | 1 + src/store/model/mediamarkt.ts | 1 + src/store/model/medimax.ts | 1 + src/store/model/megekko.ts | 1 + src/store/model/memoryexpress.ts | 1 + src/store/model/microcenter.ts | 1 + src/store/model/mindfactory.ts | 1 + src/store/model/newegg-ca.ts | 1 + src/store/model/newegg.ts | 1 + src/store/model/notebooksbilliger.ts | 1 + src/store/model/novatech.ts | 1 + src/store/model/nvidia-api.ts | 1 + src/store/model/nvidia.ts | 1 + src/store/model/officedepot.ts | 1 + src/store/model/otto.ts | 1 + src/store/model/overclockers.ts | 1 + src/store/model/pccomponentes.ts | 1 + src/store/model/playstation.ts | 1 + src/store/model/pny.ts | 1 + src/store/model/proshop-de.ts | 1 + src/store/model/proshop-dk.ts | 1 + src/store/model/saturn.ts | 1 + src/store/model/scan.ts | 3 ++- src/store/model/smythstoys.ts | 1 + src/store/model/spielegrotte.ts | 1 + src/store/model/store.ts | 1 + src/store/model/target.ts | 1 + src/store/model/topachat.ts | 1 + src/store/model/toysrus.ts | 1 + src/store/model/unieuro.ts | 1 + src/store/model/very.ts | 1 + src/store/model/vsgamers.ts | 1 + src/store/model/walmart-ca.ts | 1 + src/store/model/walmart.ts | 1 + src/store/model/wipoid.ts | 1 + src/store/model/xbox.ts | 1 + src/store/model/zotac.ts | 1 + 91 files changed, 99 insertions(+), 5 deletions(-) diff --git a/src/__test__/notification-test.ts b/src/__test__/notification-test.ts index a8b9fd0..dc630ae 100644 --- a/src/__test__/notification-test.ts +++ b/src/__test__/notification-test.ts @@ -11,6 +11,7 @@ const link: Link = { }; const store: Store = { + currency: '', labels: { inStock: { container: 'test:container', diff --git a/src/notification/discord.ts b/src/notification/discord.ts index e0c7477..5c46f10 100644 --- a/src/notification/discord.ts +++ b/src/notification/discord.ts @@ -37,7 +37,12 @@ export function sendDiscordMessage(link: Link, store: Store) { .setTimestamp(); embed.addField('Store', store.name, true); - if (link.price) embed.addField('Price', `$${link.price}`, true); + if (link.price) + embed.addField( + 'Price', + `${store.currency}${link.price}`, + true + ); embed.addField('Product Page', link.url); if (link.cartUrl) embed.addField('Add to Cart', link.cartUrl); embed.addField('Brand', link.brand, true); diff --git a/src/notification/notification.ts b/src/notification/notification.ts index ebb017a..31de64a 100644 --- a/src/notification/notification.ts +++ b/src/notification/notification.ts @@ -18,12 +18,12 @@ import {sendTwitchMessage} from './twitch'; export function sendNotification(link: Link, store: Store) { // Priority playSound(); + sendDiscordMessage(link, store); + sendDesktopNotification(link, store); sendEmail(link, store); sendSms(link, store); - sendDesktopNotification(link, store); // Non-priority adjustPhilipsHueLights(); - sendDiscordMessage(link, store); sendMqttMessage(link, store); sendPagerDutyNotification(link, store); sendPushbulletNotification(link, store); diff --git a/src/store/model/adorama.ts b/src/store/model/adorama.ts index 8053b63..ca68b40 100644 --- a/src/store/model/adorama.ts +++ b/src/store/model/adorama.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Adorama: Store = { + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/alternate-nl.ts b/src/store/model/alternate-nl.ts index 20c9f7a..753b008 100644 --- a/src/store/model/alternate-nl.ts +++ b/src/store/model/alternate-nl.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AlternateNL: Store = { + currency: '€', labels: { inStock: { container: '.stockStatus', diff --git a/src/store/model/alternate.ts b/src/store/model/alternate.ts index b40a10c..f65949d 100644 --- a/src/store/model/alternate.ts +++ b/src/store/model/alternate.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Alternate: Store = { + currency: '€', labels: { inStock: { container: '.stockStatus', diff --git a/src/store/model/amazon-ca.ts b/src/store/model/amazon-ca.ts index e16d118..6459002 100644 --- a/src/store/model/amazon-ca.ts +++ b/src/store/model/amazon-ca.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AmazonCa: Store = { + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-de-warehouse.ts b/src/store/model/amazon-de-warehouse.ts index a7c61cd..331bb18 100644 --- a/src/store/model/amazon-de-warehouse.ts +++ b/src/store/model/amazon-de-warehouse.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const AmazonDeWarehouse: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-de.ts b/src/store/model/amazon-de.ts index 0dd90a7..651562a 100644 --- a/src/store/model/amazon-de.ts +++ b/src/store/model/amazon-de.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const AmazonDe: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-es.ts b/src/store/model/amazon-es.ts index 5a1ee03..76e5456 100644 --- a/src/store/model/amazon-es.ts +++ b/src/store/model/amazon-es.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const AmazonEs: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-fr.ts b/src/store/model/amazon-fr.ts index e2ffd4e..6d1f613 100644 --- a/src/store/model/amazon-fr.ts +++ b/src/store/model/amazon-fr.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const AmazonFr: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-it.ts b/src/store/model/amazon-it.ts index 119fefc..6723592 100644 --- a/src/store/model/amazon-it.ts +++ b/src/store/model/amazon-it.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const AmazonIt: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-nl.ts b/src/store/model/amazon-nl.ts index 2043c95..3ab4f1f 100644 --- a/src/store/model/amazon-nl.ts +++ b/src/store/model/amazon-nl.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AmazonNl: Store = { + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon-uk.ts b/src/store/model/amazon-uk.ts index 35c0c4d..f9cec45 100644 --- a/src/store/model/amazon-uk.ts +++ b/src/store/model/amazon-uk.ts @@ -4,6 +4,7 @@ import {parseCard} from './helpers/card'; export const AmazonUk: Store = { backoffStatusCodes: [403, 429, 503], + currency: '£', labels: { captcha: { container: 'body', diff --git a/src/store/model/amazon.ts b/src/store/model/amazon.ts index 41f9134..d218e43 100644 --- a/src/store/model/amazon.ts +++ b/src/store/model/amazon.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Amazon: Store = { backoffStatusCodes: [403, 429, 503], + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/amd-ca.ts b/src/store/model/amd-ca.ts index 62c06d0..aa98f17 100644 --- a/src/store/model/amd-ca.ts +++ b/src/store/model/amd-ca.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AmdCa: Store = { + currency: '$', labels: { inStock: { container: '.btn-shopping-cart', diff --git a/src/store/model/amd-de.ts b/src/store/model/amd-de.ts index 139ac98..7be6e19 100644 --- a/src/store/model/amd-de.ts +++ b/src/store/model/amd-de.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AmdDe: Store = { + currency: '€', labels: { inStock: { container: '.btn-shopping-cart', diff --git a/src/store/model/amd-it.ts b/src/store/model/amd-it.ts index fe162fa..1567ca2 100644 --- a/src/store/model/amd-it.ts +++ b/src/store/model/amd-it.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AmdIt: Store = { + currency: '€', labels: { inStock: { container: '.btn-shopping-cart', diff --git a/src/store/model/amd.ts b/src/store/model/amd.ts index 814b18d..d0620bc 100644 --- a/src/store/model/amd.ts +++ b/src/store/model/amd.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Amd: Store = { + currency: '$', labels: { inStock: { container: '.btn-shopping-cart', diff --git a/src/store/model/antonline.ts b/src/store/model/antonline.ts index 7ef2c06..4a53bfd 100644 --- a/src/store/model/antonline.ts +++ b/src/store/model/antonline.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AntOnline: Store = { + currency: '$', labels: { inStock: { container: '.uk-button', diff --git a/src/store/model/argos.ts b/src/store/model/argos.ts index e340dbb..8d7bcc2 100644 --- a/src/store/model/argos.ts +++ b/src/store/model/argos.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Argos: Store = { + currency: '£', labels: { inStock: { container: 'button[data-test="add-to-trolley-button-button"', diff --git a/src/store/model/aria.ts b/src/store/model/aria.ts index a3156dd..e73c9b7 100644 --- a/src/store/model/aria.ts +++ b/src/store/model/aria.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Aria: Store = { + currency: '£', labels: { inStock: { container: '#addQuantity', diff --git a/src/store/model/arlt.ts b/src/store/model/arlt.ts index d47da28..b62f9cf 100644 --- a/src/store/model/arlt.ts +++ b/src/store/model/arlt.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Arlt: Store = { + currency: '€', labels: { inStock: { container: '.articleDesc .shippingtext', diff --git a/src/store/model/asus-de.ts b/src/store/model/asus-de.ts index 9d092ac..41d6ab2 100644 --- a/src/store/model/asus-de.ts +++ b/src/store/model/asus-de.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const AsusDe: Store = { + currency: '€', labels: { inStock: { container: '.buybox--button', diff --git a/src/store/model/asus.ts b/src/store/model/asus.ts index 5733715..d141806 100644 --- a/src/store/model/asus.ts +++ b/src/store/model/asus.ts @@ -3,6 +3,7 @@ import fetch from 'node-fetch'; export const Asus: Store = { backoffStatusCodes: [403, 429, 503], + currency: '$', labels: { inStock: { container: '#item_add_cart', diff --git a/src/store/model/awd.ts b/src/store/model/awd.ts index b373a17..0304dc7 100644 --- a/src/store/model/awd.ts +++ b/src/store/model/awd.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Awd: Store = { + currency: '£', labels: { inStock: { container: '.vs-stock .ty-qty-in-stock', diff --git a/src/store/model/azerty.ts b/src/store/model/azerty.ts index 1b07b54..2d245ec 100644 --- a/src/store/model/azerty.ts +++ b/src/store/model/azerty.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Azerty: Store = { + currency: '€', labels: { inStock: { container: '.orderdelay', diff --git a/src/store/model/bandh.ts b/src/store/model/bandh.ts index 6d30bd2..2c83224 100644 --- a/src/store/model/bandh.ts +++ b/src/store/model/bandh.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const BAndH: Store = { backoffStatusCodes: [403, 429], + currency: '$', labels: { inStock: { container: 'div[data-selenium="addToCartSection"]', diff --git a/src/store/model/bestbuy-ca.ts b/src/store/model/bestbuy-ca.ts index 2028ad0..dc34882 100644 --- a/src/store/model/bestbuy-ca.ts +++ b/src/store/model/bestbuy-ca.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const BestBuyCa: Store = { + currency: '$', labels: { inStock: { container: '.addToCartContainer_2uzan', diff --git a/src/store/model/bestbuy.ts b/src/store/model/bestbuy.ts index 9d59ae6..30dff77 100644 --- a/src/store/model/bestbuy.ts +++ b/src/store/model/bestbuy.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const BestBuy: Store = { + currency: '$', labels: { inStock: { container: diff --git a/src/store/model/box.ts b/src/store/model/box.ts index 60866be..8c6e5b4 100644 --- a/src/store/model/box.ts +++ b/src/store/model/box.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Box: Store = { + currency: '£', labels: { inStock: { container: '#divBuyButton', diff --git a/src/store/model/canadacomputers.ts b/src/store/model/canadacomputers.ts index 3c3543c..71f68b1 100644 --- a/src/store/model/canadacomputers.ts +++ b/src/store/model/canadacomputers.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const CanadaComputers: Store = { + currency: '$', labels: { inStock: { container: 'div[class="pi-prod-availability"]', diff --git a/src/store/model/caseking.ts b/src/store/model/caseking.ts index a847fac..b886f17 100644 --- a/src/store/model/caseking.ts +++ b/src/store/model/caseking.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Caseking: Store = { backoffStatusCodes: [403, 429], + currency: '€', labels: { inStock: { container: '.delivery_container', diff --git a/src/store/model/ccl.ts b/src/store/model/ccl.ts index 24da0c1..d0a91d2 100644 --- a/src/store/model/ccl.ts +++ b/src/store/model/ccl.ts @@ -3,6 +3,7 @@ import {getProductLinksBuilder} from './helpers/card'; export const Ccl: Store = { backoffStatusCodes: [403, 429, 503], + currency: '£', labels: { inStock: { container: '#pnlAddToBasket', diff --git a/src/store/model/comet.ts b/src/store/model/comet.ts index 749f576..5ada944 100644 --- a/src/store/model/comet.ts +++ b/src/store/model/comet.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Comet: Store = { + currency: '€', labels: { inStock: { container: '.caption', diff --git a/src/store/model/computeruniverse.ts b/src/store/model/computeruniverse.ts index 529ebc4..6f1bfe6 100644 --- a/src/store/model/computeruniverse.ts +++ b/src/store/model/computeruniverse.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Computeruniverse: Store = { + currency: '€', labels: { inStock: { container: '.availability', diff --git a/src/store/model/coolblue.ts b/src/store/model/coolblue.ts index b748ca0..983c6b7 100644 --- a/src/store/model/coolblue.ts +++ b/src/store/model/coolblue.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Coolblue: Store = { + currency: '€', labels: { inStock: { container: '.product-order', diff --git a/src/store/model/coolmod.ts b/src/store/model/coolmod.ts index eaef15a..ea1b5fc 100644 --- a/src/store/model/coolmod.ts +++ b/src/store/model/coolmod.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Coolmod: Store = { + currency: '€', labels: { inStock: { container: '.product-availability', diff --git a/src/store/model/corsair.ts b/src/store/model/corsair.ts index ce5c1f7..0f19717 100644 --- a/src/store/model/corsair.ts +++ b/src/store/model/corsair.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Corsair: Store = { + currency: '$', labels: { inStock: { container: '.add_to_cart_form', diff --git a/src/store/model/currys.ts b/src/store/model/currys.ts index 34f5a31..dedceb8 100644 --- a/src/store/model/currys.ts +++ b/src/store/model/currys.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Currys: Store = { + currency: '£', labels: { inStock: { container: '#product-actions button', diff --git a/src/store/model/cyberport.ts b/src/store/model/cyberport.ts index 3a739da..eb28185 100644 --- a/src/store/model/cyberport.ts +++ b/src/store/model/cyberport.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Cyberport: Store = { + currency: '€', labels: { inStock: { container: '.tooltipAvailabilityParent', diff --git a/src/store/model/ebgames.ts b/src/store/model/ebgames.ts index 9648291..d41516b 100644 --- a/src/store/model/ebgames.ts +++ b/src/store/model/ebgames.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const EbGames: Store = { + currency: '$', labels: { maxPrice: { container: '.singleVariantText .prodPriceCont' diff --git a/src/store/model/ebuyer.ts b/src/store/model/ebuyer.ts index 41d9f88..ca39eae 100644 --- a/src/store/model/ebuyer.ts +++ b/src/store/model/ebuyer.ts @@ -2,10 +2,11 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Ebuyer: Store = { + currency: '£', labels: { inStock: { container: '.purchase-info', - text: ['add to basket', 'in stock'] + text: ['add to basket', 'in stock', 'pre-order'] }, maxPrice: { container: '.purchase-info__price .price', diff --git a/src/store/model/elcorteingles.ts b/src/store/model/elcorteingles.ts index 80bc84f..5858c6e 100644 --- a/src/store/model/elcorteingles.ts +++ b/src/store/model/elcorteingles.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Elcorteingles: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { // Captcha: { // container: 'body', diff --git a/src/store/model/eprice.ts b/src/store/model/eprice.ts index 4396b03..85a1451 100644 --- a/src/store/model/eprice.ts +++ b/src/store/model/eprice.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Eprice: Store = { + currency: '€', labels: { inStock: { container: '.topSideDx', diff --git a/src/store/model/euronics-de.ts b/src/store/model/euronics-de.ts index a462491..b0d06f4 100644 --- a/src/store/model/euronics-de.ts +++ b/src/store/model/euronics-de.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const EuronicsDE: Store = { + currency: '€', labels: { inStock: { container: '.buy-btn--cart-text', diff --git a/src/store/model/euronics.ts b/src/store/model/euronics.ts index 3418fbf..54f71ff 100644 --- a/src/store/model/euronics.ts +++ b/src/store/model/euronics.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Euronics: Store = { + currency: '€', labels: { inStock: { container: '.purchaseButtonsWidth', diff --git a/src/store/model/evga-eu.ts b/src/store/model/evga-eu.ts index b22a949..10987ce 100644 --- a/src/store/model/evga-eu.ts +++ b/src/store/model/evga-eu.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const EvgaEu: Store = { + currency: '€', labels: { inStock: { container: '.product-buy-specs', diff --git a/src/store/model/evga.ts b/src/store/model/evga.ts index 87c3b3f..ce090df 100644 --- a/src/store/model/evga.ts +++ b/src/store/model/evga.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Evga: Store = { + currency: '$', labels: { inStock: { container: '.product-buy-specs', diff --git a/src/store/model/expert.ts b/src/store/model/expert.ts index 48e28ce..92ddc9f 100644 --- a/src/store/model/expert.ts +++ b/src/store/model/expert.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Expert: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { inStock: [ { diff --git a/src/store/model/galaxus.ts b/src/store/model/galaxus.ts index 0bdcd81..0174886 100644 --- a/src/store/model/galaxus.ts +++ b/src/store/model/galaxus.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Galaxus: Store = { + currency: '€', labels: { inStock: { container: '#addToCartButton:enabled', diff --git a/src/store/model/game.ts b/src/store/model/game.ts index 35fc1cf..22eaba7 100644 --- a/src/store/model/game.ts +++ b/src/store/model/game.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Game: Store = { + currency: '£', labels: { inStock: { container: '.buyingOptions', diff --git a/src/store/model/gamestop-de.ts b/src/store/model/gamestop-de.ts index 31abcf3..cad257a 100644 --- a/src/store/model/gamestop-de.ts +++ b/src/store/model/gamestop-de.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const GamestopDE: Store = { + currency: '€', labels: { inStock: [ { diff --git a/src/store/model/gamestop.ts b/src/store/model/gamestop.ts index cbef4d6..67e8023 100644 --- a/src/store/model/gamestop.ts +++ b/src/store/model/gamestop.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Gamestop: Store = { + currency: '$', labels: { inStock: [ { diff --git a/src/store/model/kabum.ts b/src/store/model/kabum.ts index 5b851f6..00ff314 100644 --- a/src/store/model/kabum.ts +++ b/src/store/model/kabum.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Kabum: Store = { + currency: 'R$', labels: { inStock: { container: '.botao-comprar', diff --git a/src/store/model/mediamarkt.ts b/src/store/model/mediamarkt.ts index d9bb1b1..a26cd6c 100644 --- a/src/store/model/mediamarkt.ts +++ b/src/store/model/mediamarkt.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Mediamarkt: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'p', diff --git a/src/store/model/medimax.ts b/src/store/model/medimax.ts index 3b5a50e..107e90c 100644 --- a/src/store/model/medimax.ts +++ b/src/store/model/medimax.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Medimax: Store = { + currency: '€', labels: { inStock: [ { diff --git a/src/store/model/megekko.ts b/src/store/model/megekko.ts index 707f96c..f3d98dc 100644 --- a/src/store/model/megekko.ts +++ b/src/store/model/megekko.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Megekko: Store = { + currency: '€', labels: { inStock: { container: '.product-order .text_green', diff --git a/src/store/model/memoryexpress.ts b/src/store/model/memoryexpress.ts index d0a7a83..d7bd600 100644 --- a/src/store/model/memoryexpress.ts +++ b/src/store/model/memoryexpress.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const MemoryExpress: Store = { + currency: '$', labels: { maxPrice: { container: diff --git a/src/store/model/microcenter.ts b/src/store/model/microcenter.ts index 6b7c710..58f1d05 100644 --- a/src/store/model/microcenter.ts +++ b/src/store/model/microcenter.ts @@ -209,6 +209,7 @@ for (const microCenterLocation of microCenterLocations) { } export const MicroCenter: Store = { + currency: '$', labels: { inStock: { container: '#cart-options', diff --git a/src/store/model/mindfactory.ts b/src/store/model/mindfactory.ts index 2723982..b42b819 100644 --- a/src/store/model/mindfactory.ts +++ b/src/store/model/mindfactory.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Mindfactory: Store = { + currency: '€', labels: { inStock: { container: '.pshipping', diff --git a/src/store/model/newegg-ca.ts b/src/store/model/newegg-ca.ts index dabe61e..35ca7c3 100644 --- a/src/store/model/newegg-ca.ts +++ b/src/store/model/newegg-ca.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import fetch from 'node-fetch'; export const NeweggCa: Store = { + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/newegg.ts b/src/store/model/newegg.ts index 4abd1a4..46a2b54 100644 --- a/src/store/model/newegg.ts +++ b/src/store/model/newegg.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import fetch from 'node-fetch'; export const Newegg: Store = { + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/notebooksbilliger.ts b/src/store/model/notebooksbilliger.ts index 2cfb2d1..0a7f1b8 100644 --- a/src/store/model/notebooksbilliger.ts +++ b/src/store/model/notebooksbilliger.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Notebooksbilliger: Store = { + currency: '€', labels: { inStock: { container: '.warehouse', diff --git a/src/store/model/novatech.ts b/src/store/model/novatech.ts index 5ba6f6e..af97c06 100644 --- a/src/store/model/novatech.ts +++ b/src/store/model/novatech.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Novatech: Store = { + currency: '£', labels: { inStock: { container: '.newspec-specprice', diff --git a/src/store/model/nvidia-api.ts b/src/store/model/nvidia-api.ts index 2d685ed..0c6c1c8 100644 --- a/src/store/model/nvidia-api.ts +++ b/src/store/model/nvidia-api.ts @@ -237,6 +237,7 @@ export const regionInfos = new Map([ ]); export const NvidiaApi: Store = { + currency: '', labels: { inStock: { container: 'body', diff --git a/src/store/model/nvidia.ts b/src/store/model/nvidia.ts index c31a2e9..0e791ee 100644 --- a/src/store/model/nvidia.ts +++ b/src/store/model/nvidia.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Nvidia: Store = { + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/officedepot.ts b/src/store/model/officedepot.ts index 6dc5a90..a972d78 100644 --- a/src/store/model/officedepot.ts +++ b/src/store/model/officedepot.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const OfficeDepot: Store = { + currency: '$', labels: { captcha: { container: 'body', diff --git a/src/store/model/otto.ts b/src/store/model/otto.ts index 466d421..4622c39 100644 --- a/src/store/model/otto.ts +++ b/src/store/model/otto.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Otto: Store = { + currency: '€', labels: { inStock: [ { diff --git a/src/store/model/overclockers.ts b/src/store/model/overclockers.ts index 822cf2e..2b7e82a 100644 --- a/src/store/model/overclockers.ts +++ b/src/store/model/overclockers.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Overclockers: Store = { + currency: '£', labels: { inStock: { container: '#detailbox', diff --git a/src/store/model/pccomponentes.ts b/src/store/model/pccomponentes.ts index 419e210..d3203af 100644 --- a/src/store/model/pccomponentes.ts +++ b/src/store/model/pccomponentes.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const PCComponentes: Store = { + currency: '€', labels: { inStock: { container: '#btnsWishAddBuy', diff --git a/src/store/model/playstation.ts b/src/store/model/playstation.ts index ec49952..e4573f9 100644 --- a/src/store/model/playstation.ts +++ b/src/store/model/playstation.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import fetch from 'node-fetch'; export const PlayStation: Store = { + currency: '$', labels: { inStock: [ { diff --git a/src/store/model/pny.ts b/src/store/model/pny.ts index 152e7c7..fabfeb5 100644 --- a/src/store/model/pny.ts +++ b/src/store/model/pny.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Pny: Store = { + currency: '$', labels: { inStock: { container: '#ctl01_lbtnAddToCart', diff --git a/src/store/model/proshop-de.ts b/src/store/model/proshop-de.ts index 5bc0c49..eef7bd5 100644 --- a/src/store/model/proshop-de.ts +++ b/src/store/model/proshop-de.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const ProshopDE: Store = { + currency: '€', labels: { maxPrice: { container: diff --git a/src/store/model/proshop-dk.ts b/src/store/model/proshop-dk.ts index 361614a..dd64da6 100644 --- a/src/store/model/proshop-dk.ts +++ b/src/store/model/proshop-dk.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const ProshopDK: Store = { + currency: 'kr.', labels: { inStock: { container: '.site-stock', diff --git a/src/store/model/saturn.ts b/src/store/model/saturn.ts index ce7d2a5..3323ae0 100644 --- a/src/store/model/saturn.ts +++ b/src/store/model/saturn.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Saturn: Store = { backoffStatusCodes: [403, 429, 503], + currency: '€', labels: { captcha: { container: 'p', diff --git a/src/store/model/scan.ts b/src/store/model/scan.ts index a7c7578..21d8b19 100644 --- a/src/store/model/scan.ts +++ b/src/store/model/scan.ts @@ -2,6 +2,7 @@ import {Store} from './store'; import {getProductLinksBuilder} from './helpers/card'; export const Scan: Store = { + currency: '£', disableAdBlocker: true, labels: { captcha: [ @@ -29,7 +30,7 @@ export const Scan: Store = { model: 'test:model', series: 'test:series', url: - 'https://www.scan.co.uk/products/msi-geforce-rtx-2060-ventus-xs-oc-6gb-gddr6-vr-ready-graphics-card-1920-core-1710mhz-boost' + 'https://www.scan.co.uk/products/nvidia-shield-tv-media-streamer-tegra-x1plus-processor-8gb-storage-2gb-ram-4k-hdr-ready-ai-upscaling' }, { brand: 'sony', diff --git a/src/store/model/smythstoys.ts b/src/store/model/smythstoys.ts index b1d1ba4..d8f37aa 100644 --- a/src/store/model/smythstoys.ts +++ b/src/store/model/smythstoys.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const SmythsToys: Store = { + currency: '£', labels: { inStock: { container: '#addToCartButton', diff --git a/src/store/model/spielegrotte.ts b/src/store/model/spielegrotte.ts index 489c6ea..d166d6d 100644 --- a/src/store/model/spielegrotte.ts +++ b/src/store/model/spielegrotte.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Spielegrotte: Store = { + currency: '€', labels: { inStock: [ { diff --git a/src/store/model/store.ts b/src/store/model/store.ts index ad2bf92..203c833 100644 --- a/src/store/model/store.ts +++ b/src/store/model/store.ts @@ -180,6 +180,7 @@ export type Store = { }; labels: Labels; name: string; + currency: '£' | '$' | '€' | 'R$' | 'kr.' | ''; setupAction?: (browser: Browser) => void; /** * The range of status codes which considered successful, i.e. without error diff --git a/src/store/model/target.ts b/src/store/model/target.ts index dafe4e7..1f28525 100644 --- a/src/store/model/target.ts +++ b/src/store/model/target.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Target: Store = { + currency: '$', labels: { inStock: [ { diff --git a/src/store/model/topachat.ts b/src/store/model/topachat.ts index 96de52e..ac33e2d 100644 --- a/src/store/model/topachat.ts +++ b/src/store/model/topachat.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const TopAchat: Store = { + currency: '€', labels: { inStock: { container: 'input.cart.button[value="Ajouter au panier"]', diff --git a/src/store/model/toysrus.ts b/src/store/model/toysrus.ts index fe03544..0ce43d3 100644 --- a/src/store/model/toysrus.ts +++ b/src/store/model/toysrus.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const ToysRUs: Store = { + currency: '$', labels: { inStock: { container: 'li.b-product_status', diff --git a/src/store/model/unieuro.ts b/src/store/model/unieuro.ts index f1f7d86..4368804 100644 --- a/src/store/model/unieuro.ts +++ b/src/store/model/unieuro.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Unieuro: Store = { + currency: '€', labels: { captcha: { container: 'body', diff --git a/src/store/model/very.ts b/src/store/model/very.ts index 09cd8f0..4865cf6 100644 --- a/src/store/model/very.ts +++ b/src/store/model/very.ts @@ -3,6 +3,7 @@ import {logger} from '../../logger'; import {parseCard} from './helpers/card'; export const Very: Store = { + currency: '£', labels: { inStock: { container: '.stockMessaging .indicator', diff --git a/src/store/model/vsgamers.ts b/src/store/model/vsgamers.ts index b9af726..d7877d6 100644 --- a/src/store/model/vsgamers.ts +++ b/src/store/model/vsgamers.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const VsGamers: Store = { + currency: '€', labels: { inStock: { container: '#vs-product-sheet-dashboard', diff --git a/src/store/model/walmart-ca.ts b/src/store/model/walmart-ca.ts index b96d410..5ef8dec 100644 --- a/src/store/model/walmart-ca.ts +++ b/src/store/model/walmart-ca.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const WalmartCa: Store = { + currency: '$', labels: { inStock: { container: '[data-automation="cta-button"]', diff --git a/src/store/model/walmart.ts b/src/store/model/walmart.ts index 7ae94b7..e24dd87 100644 --- a/src/store/model/walmart.ts +++ b/src/store/model/walmart.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Walmart: Store = { + currency: '$', labels: { inStock: { container: diff --git a/src/store/model/wipoid.ts b/src/store/model/wipoid.ts index feb8bb1..0214f49 100644 --- a/src/store/model/wipoid.ts +++ b/src/store/model/wipoid.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Wipoid: Store = { + currency: '$', labels: { inStock: { container: '#add_to_cart', diff --git a/src/store/model/xbox.ts b/src/store/model/xbox.ts index 4f8e602..198626b 100644 --- a/src/store/model/xbox.ts +++ b/src/store/model/xbox.ts @@ -1,6 +1,7 @@ import {Store} from './store'; export const Xbox: Store = { + currency: '$', labels: { outOfStock: { container: diff --git a/src/store/model/zotac.ts b/src/store/model/zotac.ts index 7fc3220..bb44750 100644 --- a/src/store/model/zotac.ts +++ b/src/store/model/zotac.ts @@ -2,6 +2,7 @@ import {Store} from './store'; export const Zotac: Store = { backoffStatusCodes: [403, 503], + currency: '$', labels: { inStock: { container: '.add-to-cart-wrapper',