From 252459d5d3de2b8cb25deee9ae318108e3dda2be Mon Sep 17 00:00:00 2001 From: admon84 Date: Sun, 20 Sep 2020 13:51:44 -0600 Subject: [PATCH] feat: card series filter, fix: newegg `oosLabels` (#120) --- .env-example | 1 + README.md | 1 + package-lock.json | 290 +++++++++++++++++++++--------- src/__test__/notification-test.ts | 3 +- src/config.ts | 1 + src/store/includes-labels.ts | 8 +- src/store/lookup.ts | 25 ++- src/store/model/adorama.ts | 50 +++--- src/store/model/amazon-ca.ts | 65 ++++--- src/store/model/amazon.ts | 75 ++++---- src/store/model/asus.ts | 11 +- src/store/model/bandh.ts | 41 +++-- src/store/model/bestbuy.ts | 47 +++-- src/store/model/evga.ts | 25 ++- src/store/model/microcenter.ts | 33 ++-- src/store/model/newegg.ts | 76 ++++---- src/store/model/nvidia.ts | 13 +- src/store/model/store.ts | 11 +- 18 files changed, 485 insertions(+), 291 deletions(-) diff --git a/.env-example b/.env-example index 7e1ebbcf10..9ecce2c76f 100644 --- a/.env-example +++ b/.env-example @@ -14,6 +14,7 @@ PUSHOVER_USER="123pushover-user-key" PAGE_SLEEP_MIN="5000" PAGE_SLEEP_MAX="10000" SHOW_ONLY_BRANDS="evga" +SHOW_ONLY_SERIES="3080" SLACK_CHANNEL="SlackChannelName" SLACK_TOKEN="slack-token" STORES="bestbuy,bandh,nvidia" diff --git a/README.md b/README.md index 7b2a9730fa..668b4c212e 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ Here is a list of variables that you can use to customize your newly copied `.en | `PAGE_SLEEP_MIN` | Minimum sleep time between queries of the same store | Default: `5000` | | `PAGE_SLEEP_MAX` | Maximum sleep time between queries of the same store | Default: `10000` | | `SHOW_ONLY_BRANDS` | Filter to show specified brands | Comma separated, E.g.: `evga,zotac` | +| `SHOW_ONLY_SERIES` | Filter to show specified series | Comma separated, E.g.: `3080` | | `SLACK_CHANNEL` | Slack channel for posting | E.g., `update`, no need for `#` | | `SLACK_TOKEN` | Slack API token | | `STORES` | [Supported stores](#supported-stores) you want to be scraped | Comma separated, default: `nvidia` | diff --git a/package-lock.json b/package-lock.json index ac213d9570..ccd5a579ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,11 +104,26 @@ "lodash": "^4.17.19" }, "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true } } }, @@ -188,6 +203,23 @@ "lodash": "^4.17.19", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@mrmlnc/readdir-enhanced": { @@ -479,6 +511,23 @@ "regexpp": "^3.0.0", "semver": "^7.3.2", "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@typescript-eslint/experimental-utils": { @@ -527,6 +576,23 @@ "lodash": "^4.17.15", "semver": "^7.3.2", "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@typescript-eslint/visitor-keys": { @@ -791,13 +857,6 @@ "requires": { "axios": "^0.19.2", "type-fest": "^0.15.1" - }, - "dependencies": { - "type-fest": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.15.1.tgz", - "integrity": "sha512-n+UXrN8i5ioo7kqT/nF8xsEzLaqFra7k32SEsSPwvXVGyAcRgV/FUQN/sgfptJTR1oRmmq7z4IXMFSM7im7C9A==" - } } }, "babel-eslint": { @@ -977,6 +1036,12 @@ "requires": { "has-flag": "^4.0.0" } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true } } }, @@ -1551,11 +1616,11 @@ "dev": true }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "requires": { - "ms": "^2.1.1" + "ms": "2.0.0" } }, "decamelize": { @@ -1896,6 +1961,14 @@ "dev": true, "requires": { "is-arrayish": "^0.2.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + } } }, "es-abstract": { @@ -2020,6 +2093,21 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2175,12 +2263,6 @@ "requires": { "ms": "2.0.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -2211,12 +2293,6 @@ "ms": "2.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -2263,12 +2339,6 @@ "path-exists": "^3.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -2393,12 +2463,6 @@ "esutils": "^2.0.2", "isarray": "^1.0.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -2508,6 +2572,12 @@ "read-pkg": "^5.2.0", "type-fest": "^0.8.1" } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true } } }, @@ -2686,12 +2756,6 @@ "requires": { "is-extendable": "^0.1.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -2790,6 +2854,21 @@ "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "fast-deep-equal": { @@ -2995,21 +3074,6 @@ "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", "requires": { "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } } }, "for-in": { @@ -3149,6 +3213,14 @@ "dev": true, "requires": { "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } } }, "globby": { @@ -3339,6 +3411,21 @@ "requires": { "agent-base": "5", "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "ieee754": { @@ -3457,10 +3544,9 @@ } }, "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, "is-buffer": { "version": "1.1.6", @@ -4016,6 +4102,13 @@ "fecha": "^4.2.0", "ms": "^2.1.1", "triple-beam": "^1.3.0" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "loose-envify": { @@ -4202,6 +4295,21 @@ "pascal-case": "^3.1.1", "snake-case": "^3.0.3", "url-join": "^4.0.1" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "messaging-api-telegram": { @@ -4417,9 +4525,9 @@ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "multimap": { "version": "1.1.0", @@ -5120,6 +5228,21 @@ "tar-fs": "^2.0.0", "unbzip2-stream": "^1.3.3", "ws": "^7.2.3" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "puppeteer-extra": { @@ -5602,13 +5725,6 @@ "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "requires": { "is-arrayish": "^0.3.1" - }, - "dependencies": { - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - } } }, "slash": { @@ -5679,12 +5795,6 @@ "requires": { "is-extendable": "^0.1.0" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -6306,10 +6416,9 @@ } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.15.1.tgz", + "integrity": "sha512-n+UXrN8i5ioo7kqT/nF8xsEzLaqFra7k32SEsSPwvXVGyAcRgV/FUQN/sgfptJTR1oRmmq7z4IXMFSM7im7C9A==" }, "typedarray-to-buffer": { "version": "3.1.5", @@ -6321,9 +6430,9 @@ } }, "typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", + "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", "dev": true }, "unbzip2-stream": { @@ -6771,6 +6880,21 @@ "update-notifier": "^4.1.0" }, "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "typescript": { "version": "3.9.7", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", diff --git a/src/__test__/notification-test.ts b/src/__test__/notification-test.ts index 0effcfe2c8..1435287dc4 100644 --- a/src/__test__/notification-test.ts +++ b/src/__test__/notification-test.ts @@ -2,11 +2,10 @@ import {Link} from '../store/model'; import {sendNotification} from '../notification'; const link: Link = { + series: 'debug', brand: 'brand', cartUrl: 'http://example.com/', - captchaLabels: ['captcha'], model: 'model', - oosLabels: ['out of stock'], url: 'http://example.com/' }; diff --git a/src/config.ts b/src/config.ts index d181235ca5..9b9c3c12fc 100644 --- a/src/config.ts +++ b/src/config.ts @@ -59,6 +59,7 @@ const page = { }; const store = { + showOnlySeries: process.env.SHOW_ONLY_SERIES ? process.env.SHOW_ONLY_SERIES.split(',') : ['3070', '3080', '3090'], showOnlyBrands: process.env.SHOW_ONLY_BRANDS ? process.env.SHOW_ONLY_BRANDS.split(',') : [], stores: process.env.STORES ? process.env.STORES.split(',') : ['nvidia'] }; diff --git a/src/store/includes-labels.ts b/src/store/includes-labels.ts index 7324883722..4c768d2808 100644 --- a/src/store/includes-labels.ts +++ b/src/store/includes-labels.ts @@ -1,10 +1,10 @@ /** - * Checks if DOM has any out-of-stock related text. + * Checks if DOM has any related text. * * @param domText Complete DOM of website. - * @param oosLabels Out-of-stock labels. + * @param searchLabels Search labels for a match. */ -export function includesLabels(domText: string, oosLabels: string[]): boolean { +export function includesLabels(domText: string, searchLabels: string[]): boolean { const domTextLowerCase = domText.toLowerCase(); - return oosLabels.some(label => domTextLowerCase.includes(label)); + return searchLabels.some(label => domTextLowerCase.includes(label)); } diff --git a/src/store/lookup.ts b/src/store/lookup.ts index 4e019557a2..cd6f211ece 100644 --- a/src/store/lookup.ts +++ b/src/store/lookup.ts @@ -20,6 +20,19 @@ function filterBrand(brand: string) { return Config.store.showOnlyBrands.includes(brand); } +/** + * Returns true if the series should be checked for stock + * + * @param series The series of the GPU + */ +function filterSeries(series: string) { + if (Config.store.showOnlySeries.length === 0) { + return true; + } + + return Config.store.showOnlySeries.includes(series); +} + /** * Responsible for looking up information about a each product within * a `Store`. It's important that we ignore `no-await-in-loop` here @@ -28,8 +41,12 @@ function filterBrand(brand: string) { * @param store Vendor of graphics cards. */ async function lookup(browser: Browser, store: Store) { -/* eslint-disable no-await-in-loop */ + /* eslint-disable no-await-in-loop */ for (const link of store.links) { + if (!filterSeries(link.series)) { + continue; + } + if (!filterBrand(link.brand)) { continue; } @@ -54,9 +71,9 @@ async function lookup(browser: Browser, store: Store) { Logger.debug(textContent); - if (includesLabels(textContent, link.oosLabels)) { + if (includesLabels(textContent, store.labels.oosList)) { Logger.info(`✖ [${store.name}] still out of stock: ${graphicsCard}`); - } else if (link.captchaLabels && includesLabels(textContent, link.captchaLabels)) { + } else if (store.labels.captchaList && includesLabels(textContent, store.labels.captchaList)) { Logger.warn(`✖ [${store.name}] CAPTCHA from: ${graphicsCard}. Waiting for a bit with this store...`); await delay(getSleepTime()); } else if (response && response.status() === 429) { @@ -81,7 +98,7 @@ async function lookup(browser: Browser, store: Store) { await page.close(); } -/* eslint-enable no-await-in-loop */ + /* eslint-enable no-await-in-loop */ } export async function tryLookupAndLoop(browser: Browser, store: Store) { diff --git a/src/store/model/adorama.ts b/src/store/model/adorama.ts index 72af003077..e05ec87bd7 100644 --- a/src/store/model/adorama.ts +++ b/src/store/model/adorama.ts @@ -3,61 +3,63 @@ import {Store} from './store'; export const Adorama: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.adorama.com/ev08gp43067k.html' + }, + { + series: '3080', brand: 'pny', model: 'xlr8', - url: 'https://www.adorama.com/pnv301tfxmpb.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/pnv301tfxmpb.html' }, { + series: '3080', brand: 'msi', model: 'gaming x trio', - url: 'https://www.adorama.com/msig380gxt1.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/msig380gxt1.html' }, { + series: '3080', brand: 'evga', model: 'ftw3 ultra', - url: 'https://www.adorama.com/ev10g53897kr.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/ev10g53897kr.html' }, { + series: '3080', brand: 'evga', model: 'xc3 ultra', - url: 'https://www.adorama.com/ev10g53885kr.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/ev10g53885kr.html' }, { + series: '3080', brand: 'evga', model: 'ftw3', - url: 'https://www.adorama.com/ev10g53895kr.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/ev10g53895kr.html' }, { + series: '3080', brand: 'evga', model: 'xc3', - url: 'https://www.adorama.com/ev10g53883kr.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/ev10g53883kr.html' }, { + series: '3080', brand: 'evga', model: 'xc3 black', - url: 'https://www.adorama.com/ev10g53881kr.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/ev10g53881kr.html' }, { + series: '3080', brand: 'msi', model: 'ventus 3x oc', - url: 'https://www.adorama.com/msig38v3x10c.html', - oosLabels: ['temporarily not available', 'out of stock'], - captchaLabels: ['please verify you are a human'] + url: 'https://www.adorama.com/msig38v3x10c.html' } ], + labels: { + oosList: ['temporarily not available', 'out of stock'], + captchaList: ['please verify you are a human'] + }, name: 'adorama' }; diff --git a/src/store/model/amazon-ca.ts b/src/store/model/amazon-ca.ts index a59119e499..7f3e9a5e2e 100644 --- a/src/store/model/amazon-ca.ts +++ b/src/store/model/amazon-ca.ts @@ -3,82 +3,81 @@ import {Store} from './store'; export const AmazonCa: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.amazon.ca/GeForce-RTX-2060-Architecture-Graphics/dp/B07PBLD2MX/ref=sr_1_2' + }, + { + series: '3080', brand: 'msi', model: 'gaming x trio', - url: 'https://www.amazon.ca/MSI-GeForce-RTX-3080-10G/dp/B08HR7SV3M?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/MSI-GeForce-RTX-3080-10G/dp/B08HR7SV3M?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'ftw3', - url: 'https://www.amazon.ca/EVGA-GeForce-Technology-Backplate-10G-P5-3895-KR/dp/B08HR3DPGW?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/EVGA-GeForce-Technology-Backplate-10G-P5-3895-KR/dp/B08HR3DPGW?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'ftw3 ultra', - url: 'https://www.amazon.ca/EVGA-GeForce-Technology-Backplate-10G-P5-3897-KR/dp/B08HR3Y5GQ?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/EVGA-GeForce-Technology-Backplate-10G-P5-3897-KR/dp/B08HR3Y5GQ?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'xc3 ultra', - url: 'https://www.amazon.ca/EVGA-GeForce-Cooling-Backplate-10G-P5-3885-KR/dp/B08HR55YB5?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/EVGA-GeForce-Cooling-Backplate-10G-P5-3885-KR/dp/B08HR55YB5?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'xc3', - url: 'https://www.amazon.ca/EVGA-GeForce-Cooling-Backplate-10G-P5-3883-KR/dp/B08HR4RJ3Q?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/EVGA-GeForce-Cooling-Backplate-10G-P5-3883-KR/dp/B08HR4RJ3Q?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'xc3 black', - url: 'https://www.amazon.ca/EVGA-GeForce-Gaming-Cooling-10G-P5-3881-KR/dp/B08HR6FMF3?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/EVGA-GeForce-Gaming-Cooling-10G-P5-3881-KR/dp/B08HR6FMF3?ref_=ast_sto_dp' }, { + series: '3080', brand: 'gigabyte', model: 'gaming oc', - url: 'https://www.amazon.ca/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080GAMING/dp/B08HJTH61J?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080GAMING/dp/B08HJTH61J?ref_=ast_sto_dp' }, { + series: '3080', brand: 'gigabyte', model: 'eagle oc', - url: 'https://www.amazon.ca/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080EAGLE/dp/B08HJS2JLJ?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080EAGLE/dp/B08HJS2JLJ?ref_=ast_sto_dp' }, { + series: '3080', brand: 'asus', model: 'tuf', - url: 'https://www.amazon.ca/Asus-90YV0FB0-M0AM00-TUF-RTX3080-10G-GAMING/dp/B08HHDP9DW?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/Asus-90YV0FB0-M0AM00-TUF-RTX3080-10G-GAMING/dp/B08HHDP9DW?ref_=ast_sto_dp' }, { + series: '3080', brand: 'asus', model: 'tuf oc', - url: 'https://www.amazon.ca/Asus-90YV0FB1-M0AM00-TUF-RTX3080-O10G-GAMING/dp/B08HH5WF97?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/Asus-90YV0FB1-M0AM00-TUF-RTX3080-O10G-GAMING/dp/B08HH5WF97?ref_=ast_sto_dp' }, { + series: '3080', brand: 'msi', model: 'ventus 3x oc', - url: 'https://www.amazon.ca/MSI-GeForce-RTX-3080-10G/dp/B08HR5SXPS?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.ca/MSI-GeForce-RTX-3080-10G/dp/B08HR5SXPS?ref_=ast_sto_dp' } ], + labels: { + oosList: ['currently unavailable'], + captchaList: ['enter the characters you see below'] + }, name: 'amazon-ca' }; diff --git a/src/store/model/amazon.ts b/src/store/model/amazon.ts index 1279940474..7d7210df3c 100644 --- a/src/store/model/amazon.ts +++ b/src/store/model/amazon.ts @@ -3,96 +3,93 @@ import {Store} from './store'; export const Amazon: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.amazon.com/MSI-GeForce-RTX-2060-Architecture/dp/B07MQ36Z6L/ref=sr_1_4' + }, + { + series: '3080', brand: 'pny', model: 'xlr8', - url: 'https://www.amazon.com/PNY-GeForce-Gaming-Epic-X-Graphics/dp/B08HBR7QBM?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/PNY-GeForce-Gaming-Epic-X-Graphics/dp/B08HBR7QBM?ref_=ast_sto_dp' }, { + series: '3080', brand: 'msi', model: 'gaming x trio', - url: 'https://www.amazon.com/MSI-GeForce-RTX-3080-10G/dp/B08HR7SV3M?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/MSI-GeForce-RTX-3080-10G/dp/B08HR7SV3M?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'ftw3 ultra', - url: 'https://www.amazon.com/EVGA-10G-P5-3897-KR-GeForce-Technology-Backplate/dp/B08HR3Y5GQ?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/EVGA-10G-P5-3897-KR-GeForce-Technology-Backplate/dp/B08HR3Y5GQ?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'xc3 ultra', - url: 'https://www.amazon.com/EVGA-10G-P5-3885-KR-GeForce-Cooling-Backplate/dp/B08HR55YB5?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/EVGA-10G-P5-3885-KR-GeForce-Cooling-Backplate/dp/B08HR55YB5?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'ftw3', - url: 'https://www.amazon.com/EVGA-10G-P5-3895-KR-GeForce-Technology-Backplate/dp/B08HR3DPGW?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/EVGA-10G-P5-3895-KR-GeForce-Technology-Backplate/dp/B08HR3DPGW?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'xc3', - url: 'https://www.amazon.com/EVGA-10G-P5-3883-KR-GeForce-Cooling-Backplate/dp/B08HR4RJ3Q?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/EVGA-10G-P5-3883-KR-GeForce-Cooling-Backplate/dp/B08HR4RJ3Q?ref_=ast_sto_dp' }, { + series: '3080', brand: 'evga', model: 'xc3 black', - url: 'https://www.amazon.com/EVGA-10G-P5-3881-KR-GeForce-GAMING-Cooling/dp/B08HR6FMF3?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/EVGA-10G-P5-3881-KR-GeForce-GAMING-Cooling/dp/B08HR6FMF3?ref_=ast_sto_dp' }, { + series: '3080', brand: 'gigabyte', model: 'gaming oc', - url: 'https://www.amazon.com/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080GAMING/dp/B08HJTH61J?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080GAMING/dp/B08HJTH61J?ref_=ast_sto_dp' }, { + series: '3080', brand: 'gigabyte', model: 'eagle oc', - url: 'https://www.amazon.com/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080EAGLE/dp/B08HJS2JLJ?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/GIGABYTE-GeForce-Graphics-WINDFORCE-GV-N3080EAGLE/dp/B08HJS2JLJ?ref_=ast_sto_dp' }, { + series: '3080', brand: 'asus', model: 'tuf oc', - url: 'https://www.amazon.com/ASUS-Graphics-DisplayPort-Military-Grade-Certification/dp/B08HH5WF97?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/ASUS-Graphics-DisplayPort-Military-Grade-Certification/dp/B08HH5WF97?ref_=ast_sto_dp' }, { + series: '3080', brand: 'asus', model: 'tuf', - url: 'https://www.amazon.com/ASUS-Graphics-DisplayPort-Military-Grade-Certification/dp/B08HHDP9DW?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/ASUS-Graphics-DisplayPort-Military-Grade-Certification/dp/B08HHDP9DW?ref_=ast_sto_dp' }, { + series: '3080', brand: 'msi', model: 'ventus 3x oc', - url: 'https://www.amazon.com/MSI-GeForce-RTX-3080-10G/dp/B08HR5SXPS?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/MSI-GeForce-RTX-3080-10G/dp/B08HR5SXPS?ref_=ast_sto_dp' }, { + series: '3080', brand: 'zotac', model: 'trinity', - url: 'https://www.amazon.com/ZOTAC-Graphics-IceStorm-Advanced-ZT-A30800D-10P/dp/B08HJNKT3P?ref_=ast_sto_dp', - oosLabels: ['currently unavailable'], - captchaLabels: ['enter the characters you see below'] + url: 'https://www.amazon.com/ZOTAC-Graphics-IceStorm-Advanced-ZT-A30800D-10P/dp/B08HJNKT3P?ref_=ast_sto_dp' } ], + labels: { + oosList: ['currently unavailable'], + captchaList: ['enter the characters you see below'] + }, name: 'amazon' }; diff --git a/src/store/model/asus.ts b/src/store/model/asus.ts index 0f23753dee..cb125cba26 100644 --- a/src/store/model/asus.ts +++ b/src/store/model/asus.ts @@ -3,18 +3,21 @@ import {Store} from './store'; export const Asus: Store = { links: [ { + series: '3080', brand: 'asus', model: 'tuf oc', - url: 'https://store.asus.com/us/item/202009AM160000001/', - oosLabels: ['coming soon', 'temporarily sold out'] + url: 'https://store.asus.com/us/item/202009AM160000001/' }, { + series: '3080', brand: 'asus', model: 'tuf', - url: 'https://store.asus.com/us/item/202009AM150000004/', - oosLabels: ['coming soon', 'temporarily sold out'] + url: 'https://store.asus.com/us/item/202009AM150000004/' } ], + labels: { + oosList: ['coming soon', 'temporarily sold out'] + }, name: 'asus' }; diff --git a/src/store/model/bandh.ts b/src/store/model/bandh.ts index d1106fd014..28e447dca2 100644 --- a/src/store/model/bandh.ts +++ b/src/store/model/bandh.ts @@ -3,54 +3,63 @@ import {Store} from './store'; export const BAndH: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.bhphotovideo.com/c/product/1452927-REG/evga_06g_p4_2063_kr_geforce_rtx_2060_xc.html' + }, + { + series: '3080', brand: 'asus', model: 'tuf', - url: 'https://www.bhphotovideo.com/c/product/1593649-REG/asus_tuf_rtx3080_10g_gaming_tuf_gaming_geforce_rtx.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593649-REG/asus_tuf_rtx3080_10g_gaming_tuf_gaming_geforce_rtx.html' }, { + series: '3080', brand: 'gigabyte', model: 'gaming oc', - url: 'https://www.bhphotovideo.com/c/product/1593333-REG/gigabyte_gv_n3080gaming_oc_10gd_geforce_rtx_3080_gaming.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593333-REG/gigabyte_gv_n3080gaming_oc_10gd_geforce_rtx_3080_gaming.html' }, { + series: '3080', brand: 'zotac', model: 'trinity', - url: 'https://www.bhphotovideo.com/c/product/1592969-REG/zotac_zt_a30800d_10p_gaming_geforce_rtx_3080.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1592969-REG/zotac_zt_a30800d_10p_gaming_geforce_rtx_3080.html' }, { + series: '3080', brand: 'asus', model: 'tuf oc', - url: 'https://www.bhphotovideo.com/c/product/1593650-REG/asus_tuf_rtx3080_o10g_gaming_tuf_gaming_geforce_rtx.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593650-REG/asus_tuf_rtx3080_o10g_gaming_tuf_gaming_geforce_rtx.html' }, { + series: '3080', brand: 'msi', model: 'gaming x trio', - url: 'https://www.bhphotovideo.com/c/product/1593996-REG/msi_g3080gxt10_geforce_rtx_3080_gaming.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593996-REG/msi_g3080gxt10_geforce_rtx_3080_gaming.html' }, { + series: '3080', brand: 'msi', model: 'ventus 3x oc', - url: 'https://www.bhphotovideo.com/c/product/1593997-REG/msi_g3080v3x10c_geforce_rtx_3080_ventus.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593997-REG/msi_g3080v3x10c_geforce_rtx_3080_ventus.html' }, { + series: '3080', brand: 'msi', model: 'gaming x trio - duplicate', - url: 'https://www.bhphotovideo.com/c/product/1593645-REG/msi_geforce_rtx_3080_gaming.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593645-REG/msi_geforce_rtx_3080_gaming.html' }, { + series: '3080', brand: 'msi', model: 'ventus 3x oc - duplicate', - url: 'https://www.bhphotovideo.com/c/product/1593646-REG/msi_geforce_rtx_3080_ventus.html', - oosLabels: ['notify when available'] + url: 'https://www.bhphotovideo.com/c/product/1593646-REG/msi_geforce_rtx_3080_ventus.html' } ], + labels: { + oosList: ['notify when available'] + }, name: 'bandh' }; diff --git a/src/store/model/bestbuy.ts b/src/store/model/bestbuy.ts index e530f3482e..6721512170 100644 --- a/src/store/model/bestbuy.ts +++ b/src/store/model/bestbuy.ts @@ -3,54 +3,63 @@ import {Store} from './store'; export const BestBuy: Store = { links: [ { - cartUrl: 'https://api.bestbuy.com/click/-/6432445/cart', + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.bestbuy.com/site/nvidia-geforce-rtx-2060-super-8gb-gddr6-pci-express-graphics-card-black-silver/6361329.p?skuId=6361329' + }, + { + series: '3080', + brand: 'nvidia', + model: 'founders edition', + url: 'https://www.bestbuy.com/site/nvidia-geforce-rtx-3080-10gb-gddr6x-pci-express-4-0-graphics-card-titanium-and-black/6429440.p?skuId=6429440', + cartUrl: 'https://api.bestbuy.com/click/-/6429440/cart' + }, + { + series: '3080', brand: 'asus', model: 'rog strix', url: 'https://www.bestbuy.com/site/asus-geforce-rtx-3080-10gb-gddr6x-pci-express-4-0-strix-graphics-card-black/6432445.p?skuId=6432445', - oosLabels: ['sold out', 'coming soon'] + cartUrl: 'https://api.bestbuy.com/click/-/6432445/cart' }, { - cartUrl: 'https://api.bestbuy.com/click/-/6432399/cart', + series: '3080', brand: 'evga', model: 'xc3 black', url: 'https://www.bestbuy.com/site/evga-geforce-rtx-3080-10gb-gddr6x-pci-express-4-0-graphics-card/6432399.p?skuId=6432399', - oosLabels: ['sold out', 'coming soon'] + cartUrl: 'https://api.bestbuy.com/click/-/6432399/cart' }, { - cartUrl: 'https://api.bestbuy.com/click/-/6432400/cart', + series: '3080', brand: 'evga', model: 'xc3 ultra', url: 'https://www.bestbuy.com/site/evga-geforce-rtx-3080-10gb-gddr6x-pci-express-4-0-graphics-card/6432400.p?skuId=6432400', - oosLabels: ['sold out', 'coming soon'] + cartUrl: 'https://api.bestbuy.com/click/-/6432400/cart' }, { - cartUrl: 'https://api.bestbuy.com/click/-/6430620/cart', + series: '3080', brand: 'gigabyte', model: 'gaming oc', url: 'https://www.bestbuy.com/site/gigabyte-geforce-rtx-3080-10g-gddr6x-pci-express-4-0-graphics-card-black/6430620.p?acampID=0&cmp=RMX&loc=Hatch&ref=198&skuId=6430620', - oosLabels: ['sold out', 'coming soon'] + cartUrl: 'https://api.bestbuy.com/click/-/6430620/cart' }, { - cartUrl: 'https://api.bestbuy.com/click/-/6430621/cart', + series: '3080', brand: 'gigabyte', model: 'eagle oc', url: 'https://www.bestbuy.com/site/gigabyte-geforce-rtx-3080-10g-gddr6x-pci-express-4-0-graphics-card-black/6430621.p?skuId=6430621', - oosLabels: ['sold out', 'coming soon'] + cartUrl: 'https://api.bestbuy.com/click/-/6430621/cart' }, { - cartUrl: 'https://api.bestbuy.com/click/-/6430175/cart', + series: '3080', brand: 'msi', model: 'ventus 3x oc', url: 'https://www.bestbuy.com/site/msi-geforce-rtx-3080-ventus-3x-10g-oc-bv-gddr6x-pci-express-4-0-graphic-card-black-silver/6430175.p?skuId=6430175', - oosLabels: ['sold out', 'coming soon'] - }, - { - cartUrl: 'https://api.bestbuy.com/click/-/6429440/cart', - brand: 'nvidia', - model: 'founders edition', - url: 'https://www.bestbuy.com/site/nvidia-geforce-rtx-3080-10gb-gddr6x-pci-express-4-0-graphics-card-titanium-and-black/6429440.p?skuId=6429440', - oosLabels: ['sold out', 'coming soon'] + cartUrl: 'https://api.bestbuy.com/click/-/6430175/cart' } ], + labels: { + oosList: ['sold out', 'coming soon'] + }, name: 'bestbuy' }; diff --git a/src/store/model/evga.ts b/src/store/model/evga.ts index 9d6c31d401..8262c2f733 100644 --- a/src/store/model/evga.ts +++ b/src/store/model/evga.ts @@ -3,30 +3,39 @@ import {Store} from './store'; export const Evga: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.evga.com/products/product.aspx?pn=06G-P4-2065-KR' + }, + { + series: '3080', brand: 'evga', model: 'xc3 black', - url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3881-KR', - oosLabels: ['out of stock'] + url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3881-KR' }, { + series: '3080', brand: 'evga', model: 'ftw3', - url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3897-KR', - oosLabels: ['out of stock'] + url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3897-KR' }, { + series: '3080', brand: 'evga', model: 'xc3', - url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3883-KR', - oosLabels: ['out of stock'] + url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3883-KR' }, { + series: '3080', brand: 'evga', model: 'xc3 ultra', - url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3885-KR', - oosLabels: ['out of stock'] + url: 'https://www.evga.com/products/product.aspx?pn=10G-P5-3885-KR' } ], + labels: { + oosList: ['out of stock'] + }, name: 'evga' }; diff --git a/src/store/model/microcenter.ts b/src/store/model/microcenter.ts index f925ad7c2f..2a84b995f4 100644 --- a/src/store/model/microcenter.ts +++ b/src/store/model/microcenter.ts @@ -3,41 +3,50 @@ import {Store} from './store'; export const MicroCenter: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.microcenter.com/product/618433/evga-geforce-rtx-2060-ko-ultra-overclocked-dual-fan-6gb-gddr6-pcie-30-graphics-card' + }, + { + series: '3080', brand: 'evga', model: 'xc3 ultra', - url: 'https://www.microcenter.com/product/628344/evga-geforce-rtx-3080-xc3-ultra-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card', - oosLabels: ['sold out'] + url: 'https://www.microcenter.com/product/628344/evga-geforce-rtx-3080-xc3-ultra-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card' }, { + series: '3080', brand: 'msi', model: 'ventus 3x', - url: 'https://www.microcenter.com/product/628331/msi-geforce-rtx-3080-ventus-3x-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card', - oosLabels: ['sold out'] + url: 'https://www.microcenter.com/product/628331/msi-geforce-rtx-3080-ventus-3x-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card' }, { + series: '3080', brand: 'asus', model: 'tuf', - url: 'https://www.microcenter.com/product/628303/asus-geforce-rtx-3080-tuf-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card', - oosLabels: ['sold out'] + url: 'https://www.microcenter.com/product/628303/asus-geforce-rtx-3080-tuf-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card' }, { + series: '3080', brand: 'msi', model: 'gaming x trio', - url: 'https://www.microcenter.com/product/628330/msi-geforce-rtx-3080-gaming-x-trio-triple-fan-10gb-gddr6x-pcie-40-graphics-card', - oosLabels: ['sold out'] + url: 'https://www.microcenter.com/product/628330/msi-geforce-rtx-3080-gaming-x-trio-triple-fan-10gb-gddr6x-pcie-40-graphics-card' }, { + series: '3080', brand: 'evga', model: 'xc3 black', - url: 'https://www.microcenter.com/product/628340/evga-geforce-rtx-3080-xc3-black-triple-fan-10gb-gddr6x-pcie-40-graphics-card', - oosLabels: ['sold out'] + url: 'https://www.microcenter.com/product/628340/evga-geforce-rtx-3080-xc3-black-triple-fan-10gb-gddr6x-pcie-40-graphics-card' }, { + series: '3080', brand: 'zotac', model: 'trinity', - url: 'https://www.microcenter.com/product/628607/zotac-geforce-rtx-3080-trinity-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card', - oosLabels: ['sold out'] + url: 'https://www.microcenter.com/product/628607/zotac-geforce-rtx-3080-trinity-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card' } ], + labels: { + oosList: ['sold out'] + }, name: 'microcenter' }; diff --git a/src/store/model/newegg.ts b/src/store/model/newegg.ts index 4dfae82bda..f42220679b 100644 --- a/src/store/model/newegg.ts +++ b/src/store/model/newegg.ts @@ -3,96 +3,94 @@ import {Store} from './store'; export const NewEgg: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://www.newegg.com/evga-geforce-rtx-2060-06g-p4-2066-kr/p/N82E16814487488', + cartUrl: 'https://api.bestbuy.com/click/-/6432445/cart' + }, + { + series: '3080', brand: 'asus', model: 'tuf', - url: 'https://www.newegg.com/asus-geforce-rtx-3080-tuf-rtx3080-10g-gaming/p/N82E16814126453', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/asus-geforce-rtx-3080-tuf-rtx3080-10g-gaming/p/N82E16814126453' }, { + series: '3080', brand: 'evga', model: 'xc3 black', - url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3881-kr/p/N82E16814487522', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3881-kr/p/N82E16814487522' }, { + series: '3080', brand: 'evga', model: 'xc3', - url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3883-kr/p/N82E16814487521', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3883-kr/p/N82E16814487521' }, { + series: '3080', brand: 'evga', model: 'xc3 ultra', - url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3885-kr/p/N82E16814487520', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3885-kr/p/N82E16814487520' }, { + series: '3080', brand: 'msi', model: 'ventus 3x', - url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-ventus-3x-10g/p/N82E16814137600', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-ventus-3x-10g/p/N82E16814137600' }, { + series: '3080', brand: 'msi', model: 'ventus 3x oc', - url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-ventus-3x-10g-oc/p/N82E16814137598', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-ventus-3x-10g-oc/p/N82E16814137598' }, { + series: '3080', brand: 'msi', model: 'gaming x trio', - url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-gaming-x-trio-10g/p/N82E16814137597', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-gaming-x-trio-10g/p/N82E16814137597' }, { + series: '3080', brand: 'gigabyte', model: 'gaming oc', - url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080gaming-oc-10gd/p/N82E16814932329', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080gaming-oc-10gd/p/N82E16814932329' }, { + series: '3080', brand: 'gigabyte', model: 'eagle oc', - url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080eagle-oc-10gd/p/N82E16814932330', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080eagle-oc-10gd/p/N82E16814932330' }, { + series: '3080', brand: 'zotac', model: 'trinity', - url: 'https://www.newegg.com/zotac-geforce-rtx-3080-zt-a30800d-10p/p/N82E16814500502', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/zotac-geforce-rtx-3080-zt-a30800d-10p/p/N82E16814500502' }, { + series: '3080', brand: 'asus', model: 'rog strix', - url: 'https://www.newegg.com/asus-geforce-rtx-3080-rog-strix-rtx3080-o10g-gaming/p/N82E16814126457', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/asus-geforce-rtx-3080-rog-strix-rtx3080-o10g-gaming/p/N82E16814126457' }, { + series: '3080', brand: 'asus', model: 'tuf oc', - url: 'https://www.newegg.com/asus-geforce-rtx-3080-tuf-rtx3080-o10g-gaming/p/N82E16814126452', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/asus-geforce-rtx-3080-tuf-rtx3080-o10g-gaming/p/N82E16814126452' }, { + series: '3080', brand: 'zotac', model: 'trinity oc', - url: 'https://www.newegg.com/zotac-geforce-rtx-3080-zt-t30800j-10p/p/N82E16814500504', - oosLabels: ['auto notify', 'out of stock'], - captchaLabels: ['are you a human?'] + url: 'https://www.newegg.com/zotac-geforce-rtx-3080-zt-t30800j-10p/p/N82E16814500504' } ], + labels: { + oosList: ['auto notify'], + captchaList: ['are you a human?'] + }, name: 'newegg' }; diff --git a/src/store/model/nvidia.ts b/src/store/model/nvidia.ts index 0108ff6d57..edd1358e78 100644 --- a/src/store/model/nvidia.ts +++ b/src/store/model/nvidia.ts @@ -3,11 +3,22 @@ import {Store} from './store'; export const Nvidia: Store = { links: [ { + series: 'debug', + brand: 'TEST', + model: 'CARD', + url: 'https://api.digitalriver.com/v1/shoppers/me/products/5379432500/inventory-status?apiKey=9485fa7b159e42edb08a83bde0d83dia', + cartUrl: 'https://www.nvidia.com/en-us/shop/geforce' + }, + { + series: '3080', brand: 'nvidia', model: 'founders edition', url: 'https://api.digitalriver.com/v1/shoppers/me/products/5438481700/inventory-status?apiKey=9485fa7b159e42edb08a83bde0d83dia', - oosLabels: ['product_inventory_out_of_stock', 'rate limit exceeded'] + cartUrl: 'https://www.nvidia.com/en-us/shop/geforce' } ], + labels: { + oosList: ['product_inventory_out_of_stock', 'rate limit exceeded'] + }, name: 'nvidia' }; diff --git a/src/store/model/store.ts b/src/store/model/store.ts index 9ee79029ab..a169ffff18 100644 --- a/src/store/model/store.ts +++ b/src/store/model/store.ts @@ -1,13 +1,18 @@ export interface Link { - cartUrl?: string; + series: string; brand: string; model: string; url: string; - oosLabels: string[]; - captchaLabels?: string[]; + cartUrl?: string; +} + +export interface Labels { + oosList: string[]; + captchaList?: string[]; } export interface Store { links: Link[]; + labels: Labels; name: string; }