Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add MSI US storefront #3199

Merged
merged 14 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/reference/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Used with the `STORES` variable.
| Microsoft | CA | `microsoft-ca` |
| MightyApe | NZ | `mightyape` |
| Mindfactory | DE | `mindfactory` |
| MSI | US | `msi` |
| MSY | AU | `msy` |
| Multicom | NO | `multicom` |
| Mwave | AU | `mwave` |
Expand Down Expand Up @@ -261,7 +262,7 @@ Used with the `SHOW_ONLY_BRANDS` and `SHOW_ONLY_MODELS` variables.
| `leadtek` | `hurricane` |
| `lianli` | `a3 matx wd` |
| `microsoft` | `xbox series s`, `xbox series x` |
| `msi` | `amd reference`, `dual`, `gaming`, `gaming trio`, `gaming trio oc`, `gaming trio oc white`, `gaming x`, `gaming x slim`, `gaming x trio`, `gaming z trio`, `mech 2x`, `mech 2x oc`, `strix`, `suprim`, `suprim liquid soc`, `suprim liquid x`, `suprim soc`, `suprim x`, `vanguard`, `vanguard soc`, `vanguard soc launch edition`, `ventus 2X (LHR)`, `ventus 2x`, `ventus 2x oc`, `ventus 3x`, `ventus 3x oc`, `ventus 3x oc plus`, `x trio` |
| `msi` | `amd reference`, `dual`, `expert`, `gaming`, `gaming trio`, `gaming trio oc`, `gaming trio oc white`, `gaming x`, `gaming x slim`, `gaming x trio`, `gaming z trio`, `inspire 3x`, `lp oc`, `mech 2x`, `mech 2x oc`, `shadow 3x`, `strix`, `suprim`, `suprim liquid soc`, `suprim liquid x`, `suprim oc`, `suprim soc`, `suprim x`, `vanguard`, `vanguard soc`, `vanguard soc launch edition`, `ventus 2X (LHR)`, `ventus 2x`, `ventus 2x oc`, `ventus 2x white oc`, `ventus 3x`, `ventus 3x e1 oc`, `ventus 3x oc`, `ventus 3x oc plus`, `x trio` |
| `nvidia` | `founders edition` |
| `palit` | `dual`, `dual oc`, `gamerock`, `gamerock oc`, `gaming oc pro`, `gaming pro`, `gaming pro oc`, `jetstream`, `jetstream oc`, `stormx oc`, `trinity oc` |
| `pny` | `dual`, `dual fan`, `epic x`, `epic x oc`, `gaming`, `gaming verto epic-x`, `single fan`, `triple fan`, `triple fan oc`, `uprising`, `vetro`, `xlr8`, `xlr8 epic x`, `xlr8 gaming`, `xlr8 gaming uprising epic x`, `xlr8 revel`, `xlr8 revel epic x`, `xlr8 uprising`, `xlr8 verto`, `xlr8 verto epic x`, `xlr8 verto epic x oc`, `xlr8 verto oc` |
Expand Down Expand Up @@ -307,6 +308,10 @@ Used with the `SHOW_ONLY_SERIES` variable.
| Nvidia RTX 3080 | `3080` |
| Nvidia RTX 3080 Ti | `3080ti` |
| Nvidia RTX 3090 | `3090` |
| Nvidia RTX 4060 | `4060` |
| Nvidia RTX 4070 | `4070` |
| Nvidia RTX 4070 SUPER | `4070super` |
| Nvidia RTX 4070 Ti | `4070ti` |
| Nvidia RTX 4080 16G | `4080-16g` |
| Nvidia RTX 4090 | `4090` |
| Nvidia RTX 5070 | `5070` |
Expand Down
8 changes: 8 additions & 0 deletions dotenv-example
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ DISCORD_NOTIFY_GROUP_3070TI=
DISCORD_NOTIFY_GROUP_3080=
DISCORD_NOTIFY_GROUP_3080TI=
DISCORD_NOTIFY_GROUP_3090=
DISCORD_NOTIFY_GROUP_4060=
DISCORD_NOTIFY_GROUP_4070=
DISCORD_NOTIFY_GROUP_4070SUPER=
DISCORD_NOTIFY_GROUP_4070TI=
DISCORD_NOTIFY_GROUP_4080_16G=
DISCORD_NOTIFY_GROUP_4090=
DISCORD_NOTIFY_GROUP_5070=
Expand Down Expand Up @@ -72,6 +76,10 @@ MAX_PRICE_SERIES_3070TI=
MAX_PRICE_SERIES_3080=
MAX_PRICE_SERIES_3080TI=
MAX_PRICE_SERIES_3090=
MAX_PRICE_SERIES_4060=
MAX_PRICE_SERIES_4070=
MAX_PRICE_SERIES_4070SUPER=
MAX_PRICE_SERIES_4070TI=
MAX_PRICE_SERIES_4080_16G=
MAX_PRICE_SERIES_4090=
MAX_PRICE_SERIES_5070=
Expand Down
54 changes: 14 additions & 40 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ const notifications = {
3080: envOrArray(process.env.DISCORD_NOTIFY_GROUP_3080),
'3080ti': envOrArray(process.env.DISCORD_NOTIFY_GROUP_3080TI),
3090: envOrArray(process.env.DISCORD_NOTIFY_GROUP_3090),
4060: envOrArray(process.env.DISCORD_NOTIFY_GROUP_4060),
4070: envOrArray(process.env.DISCORD_NOTIFY_GROUP_4070),
'4070super': envOrArray(process.env.DISCORD_NOTIFY_GROUP_4070SUPER),
'4070ti': envOrArray(process.env.DISCORD_NOTIFY_GROUP_4070TI),
'4080-16g': envOrArray(process.env.DISCORD_NOTIFY_GROUP_4080_16G),
4090: envOrArray(process.env.DISCORD_NOTIFY_GROUP_4090),
5070: envOrArray(process.env.DISCORD_NOTIFY_GROUP_5070),
Expand Down Expand Up @@ -449,6 +453,10 @@ const store = {
3080: envOrNumber(process.env.MAX_PRICE_SERIES_3080),
'3080ti': envOrNumber(process.env.MAX_PRICE_SERIES_3080TI),
3090: envOrNumber(process.env.MAX_PRICE_SERIES_3090),
4060: envOrNumber(process.env.MAX_PRICE_SERIES_4060),
4070: envOrNumber(process.env.MAX_PRICE_SERIES_4070),
'4070super': envOrNumber(process.env.MAX_PRICE_SERIES_4070SUPER),
'4070ti': envOrNumber(process.env.MAX_PRICE_SERIES_4070TI),
'4080-16g': envOrNumber(process.env.MAX_PRICE_SERIES_4080_16G),
4090: envOrNumber(process.env.MAX_PRICE_SERIES_4090),
5070: envOrNumber(process.env.MAX_PRICE_SERIES_5070),
Expand Down Expand Up @@ -499,46 +507,12 @@ const store = {
series: envOrString(series),
};
}),
showOnlySeries: envOrArray(process.env.SHOW_ONLY_SERIES, [
'3060',
'3060ti',
'3070',
'3070ti',
'3080',
'3080ti',
'3090',
'4090',
'5070',
'5070ti',
'5080',
'5090',
'g4-doorbell-pro',
'rx6700xt',
'rx6800',
'rx6800xt',
'rx6900xt',
'ryzen5600',
'ryzen5800',
'ryzen5900',
'ryzen5950',
'ryzen7950',
'ryzen9600x',
'ryzen9700x',
'ryzen9900x',
'ryzen9950x',
'ryzen7800x3d',
'ryzen9800x3d',
'sf',
'sonyps5c',
'sonyps5de',
'udm-pro',
'udm-us',
'udr-us',
'unvr',
'unvr-pro',
'xboxss',
'xboxsx',
]),
showOnlySeries: envOrArray(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much, much cleaner and clear 🥂 Thank you!

process.env.SHOW_ONLY_SERIES,
Object.keys(notifications.discord.notifyGroupSeries).filter(
series => !['test:series', 'captcha-deterrent'].includes(series)
)
),
showOnlyCountry: envOrArray(process.env.SHOW_ONLY_COUNTRY, []),
stores: envOrArray(process.env.STORES, ['amazon', 'bestbuy']).map(entry => {
const [name, minPageSleep, maxPageSleep] = entry.match(/[^:]+/g) ?? [];
Expand Down
2 changes: 2 additions & 0 deletions src/store/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import {Microsoft} from './microsoft';
import {MicrosoftCA} from './microsoft-ca';
import {MightyApe} from './mightyape';
import {Mindfactory} from './mindfactory';
import {MSI} from './msi';
import {Msy} from './msy';
import {Multicom} from './multicom';
import {Mwave} from './mwave';
Expand Down Expand Up @@ -280,6 +281,7 @@ export const storeList = new Map([
[MicrosoftCA.name, MicrosoftCA],
[MightyApe.name, MightyApe],
[Mindfactory.name, Mindfactory],
[MSI.name, MSI],
[Msy.name, Msy],
[Multicom.name, Multicom],
[Mwave.name, Mwave],
Expand Down
253 changes: 253 additions & 0 deletions src/store/model/msi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
import {Store} from './store';

export const MSI: Store = {
currency: '$',
labels: {
inStock: {
container: '#button-cart',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for those of you camping out for the pre-order launch (since MSI isnt shipping on launch day)

inStock: {
    // Unknown what the pre-order text looks like so lets see what sticks!
    container:
      '#product_qty button:not([onclick^="compare.add"]):not([onclick^="notify.showNotify"])',
    text: [''],
  }

should capture anything that isnt explicitly the existing compare or notify me buttons - this is too aggro for the production release though IMO

text: ['ADD TO CART'],
},
outOfStock: {
container: '#product_qty > button.btn.add-cart-button-3',
text: ['Notify Me'],
},
maxPrice: {
container: '#prices-new',
},
},
links: [
{
brand: 'msi',
model: 'gaming trio oc',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-GAMING-TRIO-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2480',
},
{
brand: 'msi',
model: 'gaming trio oc white',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-GAMING-TRIO-OC-WHITE",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2479',
},
{
brand: 'msi',
model: 'inspire 3x',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-INSPRIE-3X-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2481',
},
{
brand: 'msi',
model: 'shadow 3x',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-SHADOW-3X-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2485',
},
{
brand: 'msi',
model: 'suprim liquid soc',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-SUPRIM-LIQUID-SOC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2475',
},
{
brand: 'msi',
model: 'suprim soc',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-SUPRIM-SOC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2476',
},
{
brand: 'msi',
model: 'vanguard soc',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VANGUARD-SOC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2478',
},
{
brand: 'msi',
model: 'vanguard soc launch edition',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VANGUARD-SOC-LAUNCH-EDITION",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2477',
},
{
brand: 'msi',
model: 'ventus 3x',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VENTUS-3X",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2487',
},
{
brand: 'msi',
model: 'ventus 3x oc',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VENTUS-3X-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2482',
},
{
brand: 'msi',
model: 'ventus 3x oc plus',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VENTUS-3X-OC-PLUS",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2483',
},
{
brand: 'msi',
model: 'gaming trio oc',
series: '5090',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-5090-32G-GAMING-TRIO-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2473',
},
{
brand: 'msi',
model: 'suprim liquid soc',
series: '5090',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5090-32G-SUPRIM-LIQUID-SOC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2469',
},
{
brand: 'msi',
model: 'suprim oc',
series: '5090',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/Geforce-RTX-5090-32G-SUPRIM-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2470',
},
{
brand: 'msi',
model: 'vanguard soc',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VANGUARD-SOC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2472',
},
{
brand: 'msi',
model: 'vanguard soc launch edition',
series: '5090',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5090-32G-VANGUARD-SOC-LAUNCH-EDITION",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2471',
},
{
brand: 'msi',
model: 'ventus 3x',
series: '5080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5080-16G-VENTUS-3X",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2478',
},
{
brand: 'msi',
model: 'ventus 3x oc',
series: '5090',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series/GeForce-RTX-5090-32G-VENTUS-3X-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-50-Series?product_id=2474',
},
{
brand: 'msi',
model: 'ventus 2x oc',
series: '4060',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4060-VENTUS-2X-BLACK-8G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=1799',
},
{
brand: 'msi',
model: 'ventus 2x white oc',
series: '4060',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4060-VENTUS-2X-WHITE-8G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=1852',
},
{
brand: 'msi',
model: 'gaming x slim',
series: '4070super',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4070-SUPER-12G-GAMING-X-SLIM",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=2055',
},
{
brand: 'msi',
model: 'ventus 2x oc',
series: '4070super',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4070-SUPER-12G-VENTUS-2X-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=2057',
},
{
brand: 'msi',
model: 'ventus 3x oc',
series: '4070super',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4070-SUPER-12G-VENTUS-3X-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=2050',
},
{
brand: 'msi',
model: 'expert',
series: '4070ti',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4070-Ti-SUPER-16G-EXPERT",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=2174',
},
{
brand: 'msi',
model: 'ventus 3x oc',
series: '4070',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4070-VENTUS-3X-12G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=1741',
},
{
brand: 'msi',
model: 'ventus 3x e1 oc',
series: '4070',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series/GeForce-RTX-4070-VENTUS-3X-E1-12G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-40-Series?product_id=2361',
},
{
brand: 'msi',
model: 'gaming x',
series: '3050',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3050-GAMING-X-6G",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=2140',
},
{
brand: 'msi',
model: 'lp oc',
series: '3050',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3050-LP-6G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=2138',
},
{
brand: 'msi',
model: 'ventus 2x oc',
series: '3050',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3050-VENTUS-2X-6G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=2139',
},
{
brand: 'msi',
model: 'gaming trio',
series: '3080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3080-Gaming-Z-Trio-10G-LHR",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=954',
},
{
brand: 'msi',
model: 'gaming trio',
series: '3080',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3080-GAMING-Z-TRIO-12G-LHR",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=1246',
},
{
brand: 'msi',
model: 'gaming x trio',
series: '3080ti',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3080-Ti-Gaming-X-Trio-12G",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=940',
},
{
brand: 'msi',
model: 'ventus 3x oc',
series: '3080ti',
// "https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series/GeForce-RTX-3080-Ti-Ventus-3X-12G-OC",
url: 'https://us-store.msi.com/Graphics-Cards/NVIDIA-GPU/GeForce-RTX-30-Series?product_id=939',
},
],
name: 'msi',
country: 'US',
};
Loading