mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 07:37:39 +00:00
feat(nvidia): updated store for europe (#1732)
This commit is contained in:
+17
-32
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
| Environment variable | Description |
|
| Environment variable | Description |
|
||||||
|:---:|---|
|
|:---:|---|
|
||||||
| `COUNTRY` | [Supported country](#supported-countries) you want to be scraped | Only used with `nvidia-api`, default: `usa` |
|
|
||||||
| `MAX_PRICE_SERIES_3060TI` | Maximum price allowed for a match, applies 3060 Ti series cards (does not apply to these sites: Nvidia, Asus, EVGA) |
|
| `MAX_PRICE_SERIES_3060TI` | Maximum price allowed for a match, applies 3060 Ti series cards (does not apply to these sites: Nvidia, Asus, EVGA) |
|
||||||
| `MAX_PRICE_SERIES_3070` | Maximum price allowed for a match, applies 3070 series cards (does not apply to these sites: Nvidia, Asus, EVGA) |
|
| `MAX_PRICE_SERIES_3070` | Maximum price allowed for a match, applies 3070 series cards (does not apply to these sites: Nvidia, Asus, EVGA) |
|
||||||
| `MAX_PRICE_SERIES_3080` | Maximum price allowed for a match, applies 3080 series cards (does not apply to these sites: Nvidia, Asus, EVGA) |
|
| `MAX_PRICE_SERIES_3080` | Maximum price allowed for a match, applies 3080 series cards (does not apply to these sites: Nvidia, Asus, EVGA) |
|
||||||
@@ -22,15 +21,13 @@
|
|||||||
| `MAX_PRICE_SERIES_XBOXSX` | Maximum price allowed for a match, applies PS5 digital edition |
|
| `MAX_PRICE_SERIES_XBOXSX` | Maximum price allowed for a match, applies PS5 digital edition |
|
||||||
| `MAX_PRICE_SERIES_TEST` | Maximum price allowed for a match, applies `test:series` |
|
| `MAX_PRICE_SERIES_TEST` | Maximum price allowed for a match, applies `test:series` |
|
||||||
| `MICROCENTER_LOCATION` | Specific MicroCenter location(s) to search. Comma separated, e.g.: `marietta,duluth`, default: `web` |
|
| `MICROCENTER_LOCATION` | Specific MicroCenter location(s) to search. Comma separated, e.g.: `marietta,duluth`, default: `web` |
|
||||||
| `NVIDIA_ADD_TO_CART_ATTEMPTS` | The maximum number of times the `nvidia-api` add to cart feature will be attempted before failing. Default: `10` |
|
|
||||||
| `NVIDIA_SESSION_TTL` | The time in milliseconds to keep the cart active while using `nvidia-api`. Default: `60000` |
|
|
||||||
| `SHOW_ONLY_BRANDS` | Filter to show specified brands. Comma separated, e.g.: `evga,zotac` |
|
| `SHOW_ONLY_BRANDS` | Filter to show specified brands. Comma separated, e.g.: `evga,zotac` |
|
||||||
| `SHOW_ONLY_MODELS` | Filter to show specified models. Comma separated, can include series. E.g.: `founders edition:3090,rog strix` |
|
| `SHOW_ONLY_MODELS` | Filter to show specified models. Comma separated, can include series. E.g.: `founders edition:3090,rog strix` |
|
||||||
| `SHOW_ONLY_SERIES` | Filter to show specified series. Comma separated, e.g.: `3080,ryzen5900` |
|
| `SHOW_ONLY_SERIES` | Filter to show specified series. Comma separated, e.g.: `3080,ryzen5900` |
|
||||||
| `STORES` | [Supported stores](#supported-stores) you want to be scraped. Default: `amazon,bestbuy`. Comma separated, can include `PAGE_SLEEP_MIN` and `PAGE_SLEEP_MAX` values. E.g.: `amazon:10000:30000,bestbuy,newegg:50000:80000`. |
|
| `STORES` | [Supported stores](#supported-stores) you want to be scraped. Default: `amazon,bestbuy`. Comma separated, can include `PAGE_SLEEP_MIN` and `PAGE_SLEEP_MAX` values. E.g.: `amazon:10000:30000,bestbuy,newegg:50000:80000`. |
|
||||||
|
|
||||||
???+ note
|
???+ note
|
||||||
For `MAX_PRICE_SERIES_*` variables: enter a price (enter whole dollar amounts only, avoid use of: dollar symbols, commas, and periods). E.g.: `1234`. Merchandise found above this price will be skipped.
|
For `MAX_PRICE_SERIES_*` variables: Use whole numbers only (no currency symbol is required). Avoid using any commas or decimal points. Example: `1234`. Merchandise found above this price will be skipped.
|
||||||
|
|
||||||
## Supported stores
|
## Supported stores
|
||||||
|
|
||||||
@@ -128,8 +125,7 @@ Used with the `STORES` variable.
|
|||||||
| Newegg | SG | `newegg-sg`|
|
| Newegg | SG | `newegg-sg`|
|
||||||
| Notebooksbilliger | DE |`notebooksbilliger`|
|
| Notebooksbilliger | DE |`notebooksbilliger`|
|
||||||
| Novatech | UK | `novatech`|
|
| Novatech | UK | `novatech`|
|
||||||
| Nvidia | US | `nvidia`|
|
| Nvidia | EU/UK/USA | [See below](#Nvidia-Store-Reference) |
|
||||||
| Nvidia API | | `nvidia-api`|
|
|
||||||
| Office Depot | US | `officedepot`|
|
| Office Depot | US | `officedepot`|
|
||||||
| Ollo | IT | `ollo`|
|
| Ollo | IT | `ollo`|
|
||||||
| Otto | DE | `otto`|
|
| Otto | DE | `otto`|
|
||||||
@@ -235,32 +231,21 @@ Used with the `SHOW_ONLY_SERIES` variable.
|
|||||||
| Xbox Series S | `xboxss` |
|
| Xbox Series S | `xboxss` |
|
||||||
| Xbox Series X | `xboxsx` |
|
| Xbox Series X | `xboxsx` |
|
||||||
|
|
||||||
## Supported countries
|
## Nvidia Store Reference
|
||||||
|
|
||||||
Used with the `COUNTRY` variable.
|
???+ note
|
||||||
|
For Founders Edition cards. Use the `store` variable for your chosen country.
|
||||||
|
For example, to buy a FE card in Belgium you would use the `nvidia-fr` store.
|
||||||
|
|
||||||
???+ attention
|
| Country | 3060 Ti | 3070 | 3080 | 3090 | Store | Retailer
|
||||||
Used _only_ with `nvidia` and `nvidia-api`.
|
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
||||||
|
| Austria | `✔` | `✔` | `✔` | `✔` | `nvidia-de`| NBB |
|
||||||
| Country | 3080 FE | 3090 FE | Test Card | Notes |
|
| Belgium | `✔` | `✔` | `✔` | `✔` | `nvidia-fr` | LDLC |
|
||||||
|:---:|:---:|:---:|:---:|:---:|
|
| France | `✔` | `✔` | `✔` | `✔` | `nvidia-fr` | LDLC |
|
||||||
| `austria` | `✔` | `✔` | `✔` | |
|
| Germany | `✔` | `✔` | `✔` | `✔` | `nvidia-de` | NBB |
|
||||||
| `belgium` | `✔` | `✔` | `✔` | |
|
| Ireland | `✔` | `✔` | `✔` | `✔` | `nvidia-gb` | Scan |
|
||||||
| `canada` | `✔` | `✔` | `✔` | |
|
| Luxembourg | `✔` | `✔` | `✔` | `✔` | `nvidia-fr` | LDLC |
|
||||||
| `czechia` | `✔` | `✔` | `✔` | |
|
| Spain | `✔` | `✔` | `✔` | `✔` | `nvidia-es` | LDLC |
|
||||||
| `denmark` | `✔` | | `✔` | Missing RTX 3090 |
|
| United Kingdom | `✔` | `✔` | `✔` | `✔` | `nvidia-gb` | Scan |
|
||||||
| `finland` | `✔` | | `✔` | Missing RTX 3090 |
|
| USA | `✔` | `✔` | `✔` | `✔` | `bestbuy` | BestBuy |
|
||||||
| `france` | `✔` | `✔` | `✔` | |
|
|
||||||
| `germany` | `✔` | `✔` | `✔` | |
|
|
||||||
| `great_britain` | `✔` | `✔` | `✔` | |
|
|
||||||
| `ireland` | `✔` | `✔` | `✔` | |
|
|
||||||
| `italy` | `✔` | `✔` | `✔` | |
|
|
||||||
| `luxembourg` | `✔` | `✔` | `✔` | |
|
|
||||||
| `netherlands` | `✔` | `✔` | `✔` | |
|
|
||||||
| `norway` | `✔` | `✔` | `✔` | |
|
|
||||||
| `poland` | `✔` | `✔` | `✔` | |
|
|
||||||
| `portugal` | `✔` | | | RTX 3080 only |
|
|
||||||
| `spain` | `✔` | `✔` | `✔` | |
|
|
||||||
| `sweden` | `✔` | `✔` | `✔` | |
|
|
||||||
| `usa` | `✔` | `✔` | `✔` | |
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,192 +0,0 @@
|
|||||||
import {NvidiaRegionInfo, regionInfos} from '../nvidia-api';
|
|
||||||
import {usingPage, usingResponse} from '../../../util';
|
|
||||||
import {Browser} from 'puppeteer';
|
|
||||||
import {config} from '../../../config';
|
|
||||||
import {logger} from '../../../logger';
|
|
||||||
import open from 'open';
|
|
||||||
|
|
||||||
interface NvidiaSessionTokenJSON {
|
|
||||||
session_token: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NvidiaAddToCardJSON {
|
|
||||||
location: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class NvidiaCart {
|
|
||||||
protected readonly browser: Browser;
|
|
||||||
protected isKeepAlive = false;
|
|
||||||
protected sessionToken: string | null = null;
|
|
||||||
|
|
||||||
public constructor(browser: Browser) {
|
|
||||||
this.browser = browser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public keepAlive() {
|
|
||||||
if (this.isKeepAlive) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const callback = async () => {
|
|
||||||
if (!this.isKeepAlive) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.refreshSessionToken();
|
|
||||||
|
|
||||||
setTimeout(callback, config.nvidia.sessionTtl);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.isKeepAlive = true;
|
|
||||||
|
|
||||||
void callback();
|
|
||||||
}
|
|
||||||
|
|
||||||
public get fallbackCartUrl(): string {
|
|
||||||
return `https://www.nvidia.com/${this.regionInfo.siteLocale}/geforce/`;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get regionInfo(): NvidiaRegionInfo {
|
|
||||||
const country = config.store.country.toLowerCase();
|
|
||||||
const regionInfo = regionInfos.get(country);
|
|
||||||
if (!regionInfo) {
|
|
||||||
throw new Error(`Unknown country ${country}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return regionInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get sessionUrl(): string {
|
|
||||||
return `https://store.nvidia.com/store/nvidia/SessionToken?format=json&locale=${this.regionInfo.drLocale}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async addToCard(productId: number, name: string): Promise<string> {
|
|
||||||
let cartUrl: string | undefined;
|
|
||||||
logger.info(`🚀🚀🚀 [nvidia] ${name}, starting auto add to cart 🚀🚀🚀`);
|
|
||||||
try {
|
|
||||||
logger.info(`🚀🚀🚀 [nvidia] ${name}, adding to cart 🚀🚀🚀`);
|
|
||||||
let lastError: Error | string | undefined;
|
|
||||||
|
|
||||||
/* eslint-disable no-await-in-loop */
|
|
||||||
for (let i = 0; i < config.nvidia.addToCardAttempts; i++) {
|
|
||||||
try {
|
|
||||||
cartUrl = await this.addToCartAndGetLocationRedirect(productId);
|
|
||||||
|
|
||||||
break;
|
|
||||||
} catch (error: unknown) {
|
|
||||||
logger.error(
|
|
||||||
`✖ [nvidia] ${name} could not automatically add to cart, attempt ${
|
|
||||||
i + 1
|
|
||||||
} of ${config.nvidia.addToCardAttempts}`,
|
|
||||||
error
|
|
||||||
);
|
|
||||||
logger.debug(error);
|
|
||||||
|
|
||||||
lastError = error as Error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* eslint-enable no-await-in-loop */
|
|
||||||
|
|
||||||
if (!cartUrl) {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-throw-literal
|
|
||||||
throw lastError;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info(`🚀🚀🚀 [nvidia] ${name}, opening checkout page 🚀🚀🚀`);
|
|
||||||
logger.info(cartUrl);
|
|
||||||
|
|
||||||
await open(cartUrl);
|
|
||||||
} catch (error: unknown) {
|
|
||||||
logger.error(
|
|
||||||
`✖ [nvidia] ${name} could not automatically add to cart, opening page`,
|
|
||||||
error
|
|
||||||
);
|
|
||||||
|
|
||||||
cartUrl = this.fallbackCartUrl;
|
|
||||||
|
|
||||||
await open(cartUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cartUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getSessionToken(): Promise<string> {
|
|
||||||
if (!this.sessionToken) {
|
|
||||||
await this.refreshSessionToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.sessionToken) {
|
|
||||||
throw new Error('Failed to create the session_token.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.sessionToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async refreshSessionToken(): Promise<void> {
|
|
||||||
logger.debug('ℹ [nvidia] refreshing session token');
|
|
||||||
try {
|
|
||||||
const result = await usingResponse(
|
|
||||||
this.browser,
|
|
||||||
this.sessionUrl,
|
|
||||||
async response => {
|
|
||||||
return response?.json() as NvidiaSessionTokenJSON | undefined;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (
|
|
||||||
typeof result !== 'object' ||
|
|
||||||
result === null ||
|
|
||||||
!('session_token' in result)
|
|
||||||
) {
|
|
||||||
throw new Error('malformed response');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sessionToken = result.session_token;
|
|
||||||
logger.debug(`ℹ [nvidia] session_token=${result.session_token}`);
|
|
||||||
} catch (error: unknown) {
|
|
||||||
const message: string =
|
|
||||||
typeof error === 'object'
|
|
||||||
? (error as Error).message
|
|
||||||
: (error as string);
|
|
||||||
logger.error(`✖ [nvidia] ${message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async addToCartAndGetLocationRedirect(
|
|
||||||
productId: number
|
|
||||||
): Promise<string> {
|
|
||||||
const url = 'https://api-prod.nvidia.com/direct-sales-shop/DR/add-to-cart';
|
|
||||||
const sessionToken = await this.getSessionToken();
|
|
||||||
|
|
||||||
logger.info(`ℹ [nvidia] session_token=${sessionToken}`);
|
|
||||||
|
|
||||||
const locationData = await usingPage(this.browser, async page => {
|
|
||||||
page.removeAllListeners('request');
|
|
||||||
|
|
||||||
await page.setRequestInterception(true);
|
|
||||||
|
|
||||||
page.on('request', interceptedRequest => {
|
|
||||||
void interceptedRequest.continue({
|
|
||||||
headers: {
|
|
||||||
...interceptedRequest.headers(),
|
|
||||||
'content-type': 'application/json',
|
|
||||||
nvidia_shop_id: sessionToken,
|
|
||||||
},
|
|
||||||
method: 'POST',
|
|
||||||
postData: JSON.stringify({
|
|
||||||
products: [{productId, quantity: 1}],
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const response = await page.goto(url, {waitUntil: 'networkidle0'});
|
|
||||||
|
|
||||||
if (response === null) {
|
|
||||||
throw new Error('NvidiaAddToCartUnavailable');
|
|
||||||
}
|
|
||||||
|
|
||||||
return response.json() as Promise<NvidiaAddToCardJSON>;
|
|
||||||
});
|
|
||||||
|
|
||||||
return locationData.location;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
import {NvidiaRegionInfo, regionInfos} from '../nvidia-api';
|
|
||||||
import {Browser} from 'puppeteer';
|
|
||||||
import {Link} from '../store';
|
|
||||||
import {NvidiaCart} from './nvidia-cart';
|
|
||||||
import {config} from '../../../config';
|
|
||||||
import {timestampUrlParameter} from '../../timestamp-url-parameter';
|
|
||||||
|
|
||||||
function getRegionInfo(): NvidiaRegionInfo {
|
|
||||||
let country = config.store.country.toLowerCase();
|
|
||||||
if (!regionInfos.has(country)) {
|
|
||||||
country = 'usa';
|
|
||||||
}
|
|
||||||
|
|
||||||
const regionInfo = regionInfos.get(country);
|
|
||||||
if (!regionInfo) {
|
|
||||||
throw new Error(
|
|
||||||
`LogicException could not retrieve region info for ${country}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return regionInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
function nvidiaStockUrl(
|
|
||||||
id: number,
|
|
||||||
drLocale: string,
|
|
||||||
currency: string
|
|
||||||
): string {
|
|
||||||
return (
|
|
||||||
`https://api-prod.nvidia.com/direct-sales-shop/DR/products/${drLocale}/${currency}/${id}?` +
|
|
||||||
timestampUrlParameter().slice(1)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let cart: NvidiaCart;
|
|
||||||
|
|
||||||
export function generateSetupAction() {
|
|
||||||
return async (browser: Browser) => {
|
|
||||||
cart = new NvidiaCart(browser);
|
|
||||||
|
|
||||||
if (config.browser.open) {
|
|
||||||
cart.keepAlive();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function generateOpenCartAction(id: number, cardName: string) {
|
|
||||||
return async () => {
|
|
||||||
const url = await cart.addToCard(id, cardName);
|
|
||||||
|
|
||||||
return url;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function generateLinks(): Link[] {
|
|
||||||
const {
|
|
||||||
drLocale,
|
|
||||||
fe3080Id,
|
|
||||||
fe3090Id,
|
|
||||||
fe2060SuperId,
|
|
||||||
currency,
|
|
||||||
} = getRegionInfo();
|
|
||||||
|
|
||||||
const links: Link[] = [];
|
|
||||||
|
|
||||||
if (fe2060SuperId) {
|
|
||||||
links.push({
|
|
||||||
brand: 'test:brand',
|
|
||||||
model: 'test:model',
|
|
||||||
openCartAction: generateOpenCartAction(fe2060SuperId, 'TEST CARD debug'),
|
|
||||||
series: 'test:series',
|
|
||||||
url: nvidiaStockUrl(fe2060SuperId, drLocale, currency),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fe3080Id) {
|
|
||||||
links.push({
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
openCartAction: generateOpenCartAction(
|
|
||||||
fe3080Id,
|
|
||||||
'nvidia founders edition 3080'
|
|
||||||
),
|
|
||||||
series: '3080',
|
|
||||||
url: nvidiaStockUrl(fe3080Id, drLocale, currency),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fe3090Id) {
|
|
||||||
links.push({
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
openCartAction: generateOpenCartAction(
|
|
||||||
fe3090Id,
|
|
||||||
'nvidia founders edition 3090'
|
|
||||||
),
|
|
||||||
series: '3090',
|
|
||||||
url: nvidiaStockUrl(fe3090Id, drLocale, currency),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return links;
|
|
||||||
}
|
|
||||||
@@ -89,8 +89,10 @@ import {NeweggCa} from './newegg-ca';
|
|||||||
import {NeweggSg} from './newegg-sg';
|
import {NeweggSg} from './newegg-sg';
|
||||||
import {Notebooksbilliger} from './notebooksbilliger';
|
import {Notebooksbilliger} from './notebooksbilliger';
|
||||||
import {Novatech} from './novatech';
|
import {Novatech} from './novatech';
|
||||||
import {Nvidia} from './nvidia';
|
import {NvidiaDE} from './nvidia-de';
|
||||||
import {NvidiaApi} from './nvidia-api';
|
import {NvidiaES} from './nvidia-es';
|
||||||
|
import {NvidiaFR} from './nvidia-fr';
|
||||||
|
import {NvidiaGB} from './nvidia-gb';
|
||||||
import {OfficeDepot} from './officedepot';
|
import {OfficeDepot} from './officedepot';
|
||||||
import {Ollo} from './ollo';
|
import {Ollo} from './ollo';
|
||||||
import {Otto} from './otto';
|
import {Otto} from './otto';
|
||||||
@@ -224,8 +226,10 @@ export const storeList = new Map([
|
|||||||
[NeweggSg.name, NeweggSg],
|
[NeweggSg.name, NeweggSg],
|
||||||
[Notebooksbilliger.name, Notebooksbilliger],
|
[Notebooksbilliger.name, Notebooksbilliger],
|
||||||
[Novatech.name, Novatech],
|
[Novatech.name, Novatech],
|
||||||
[Nvidia.name, Nvidia],
|
[NvidiaDE.name, NvidiaDE],
|
||||||
[NvidiaApi.name, NvidiaApi],
|
[NvidiaES.name, NvidiaES],
|
||||||
|
[NvidiaFR.name, NvidiaFR],
|
||||||
|
[NvidiaGB.name, NvidiaGB],
|
||||||
[OfficeDepot.name, OfficeDepot],
|
[OfficeDepot.name, OfficeDepot],
|
||||||
[Ollo.name, Ollo],
|
[Ollo.name, Ollo],
|
||||||
[Otto.name, Otto],
|
[Otto.name, Otto],
|
||||||
@@ -326,11 +330,6 @@ function printConfig() {
|
|||||||
|
|
||||||
function warnIfStoreDeprecated(store: Store) {
|
function warnIfStoreDeprecated(store: Store) {
|
||||||
switch (store.name) {
|
switch (store.name) {
|
||||||
case 'nvidia':
|
|
||||||
case 'nvidia-api':
|
|
||||||
if (config.store.country === 'usa')
|
|
||||||
logger.warn(`${store.name} is deprecated in favor of bestbuy`);
|
|
||||||
break;
|
|
||||||
case 'evga':
|
case 'evga':
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`${store.name} is deprecated since they only support queuing`
|
`${store.name} is deprecated since they only support queuing`
|
||||||
|
|||||||
@@ -1,250 +0,0 @@
|
|||||||
import {generateLinks, generateSetupAction} from './helpers/nvidia';
|
|
||||||
import {Store} from './store';
|
|
||||||
|
|
||||||
// Region/country set by config file, silently ignores null / missing values and defaults to usa
|
|
||||||
|
|
||||||
export interface NvidiaRegionInfo {
|
|
||||||
currency: string;
|
|
||||||
drLocale: string;
|
|
||||||
fe3080Id: number | null;
|
|
||||||
fe3090Id: number | null;
|
|
||||||
fe2060SuperId: number | null;
|
|
||||||
siteLocale: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const regionInfos = new Map<string, NvidiaRegionInfo>([
|
|
||||||
[
|
|
||||||
'austria',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'de_de',
|
|
||||||
fe2060SuperId: 5394902900,
|
|
||||||
fe3080Id: 5440853700,
|
|
||||||
fe3090Id: 5444941400,
|
|
||||||
siteLocale: 'de-at',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'belgium',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'fr_fr',
|
|
||||||
fe2060SuperId: 5394902700,
|
|
||||||
fe3080Id: 5438795700,
|
|
||||||
fe3090Id: 5438795600,
|
|
||||||
siteLocale: 'fr-be',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'canada',
|
|
||||||
{
|
|
||||||
currency: 'CAD',
|
|
||||||
drLocale: 'en_us',
|
|
||||||
fe2060SuperId: 5379432500,
|
|
||||||
fe3080Id: 5438481700,
|
|
||||||
fe3090Id: 5438481600,
|
|
||||||
siteLocale: 'en-us',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'czechia',
|
|
||||||
{
|
|
||||||
currency: 'CZK',
|
|
||||||
drLocale: 'en_gb',
|
|
||||||
fe2060SuperId: 5394902800,
|
|
||||||
fe3080Id: 5438793800,
|
|
||||||
fe3090Id: 5438793600,
|
|
||||||
siteLocale: 'cs-cz',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'denmark',
|
|
||||||
{
|
|
||||||
currency: 'DKK',
|
|
||||||
drLocale: 'en_gb',
|
|
||||||
fe2060SuperId: 5394903100,
|
|
||||||
fe3080Id: 5438793300,
|
|
||||||
fe3090Id: null,
|
|
||||||
siteLocale: 'da-dk',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'finland',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'en_gb',
|
|
||||||
fe2060SuperId: 5394903100,
|
|
||||||
fe3080Id: 5438793300,
|
|
||||||
fe3090Id: null,
|
|
||||||
siteLocale: 'fi-fi',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'france',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'fr_fr',
|
|
||||||
fe2060SuperId: 5394903200,
|
|
||||||
fe3080Id: 5438795200,
|
|
||||||
fe3090Id: 5438761500,
|
|
||||||
siteLocale: 'fr-fr',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'germany',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'de_de',
|
|
||||||
fe2060SuperId: 5394902900,
|
|
||||||
fe3080Id: 5438792300,
|
|
||||||
fe3090Id: 5438761400,
|
|
||||||
siteLocale: 'de-de',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'great_britain',
|
|
||||||
{
|
|
||||||
currency: 'GBP',
|
|
||||||
drLocale: 'en_gb',
|
|
||||||
fe2060SuperId: 5394903300,
|
|
||||||
fe3080Id: 5438792800,
|
|
||||||
fe3090Id: 5438792700,
|
|
||||||
siteLocale: 'en-gb',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'ireland',
|
|
||||||
{
|
|
||||||
currency: 'GBP',
|
|
||||||
drLocale: 'en_gb',
|
|
||||||
fe2060SuperId: 5394903300,
|
|
||||||
fe3080Id: 5438792800,
|
|
||||||
fe3090Id: 5438792700,
|
|
||||||
siteLocale: 'en-gb',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'italy',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'it_it',
|
|
||||||
fe2060SuperId: 5394903400,
|
|
||||||
fe3080Id: 5438796200,
|
|
||||||
fe3090Id: 5438796100,
|
|
||||||
siteLocale: 'it-it',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'luxembourg',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'fr_fr',
|
|
||||||
fe2060SuperId: 5394902700,
|
|
||||||
fe3080Id: 5438795700,
|
|
||||||
fe3090Id: 5438795600,
|
|
||||||
siteLocale: 'fr-be',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'netherlands',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'nl_nl',
|
|
||||||
fe2060SuperId: 5394903500,
|
|
||||||
fe3080Id: 5438796700,
|
|
||||||
fe3090Id: 5438796600,
|
|
||||||
siteLocale: 'nl-nl',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'norway',
|
|
||||||
{
|
|
||||||
currency: 'NOK',
|
|
||||||
drLocale: 'no_no',
|
|
||||||
fe2060SuperId: 5394903600,
|
|
||||||
fe3080Id: 5438797200,
|
|
||||||
fe3090Id: 5438797100,
|
|
||||||
siteLocale: 'nb-no',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'poland',
|
|
||||||
{
|
|
||||||
currency: 'PLN',
|
|
||||||
drLocale: 'pl_pl',
|
|
||||||
fe2060SuperId: 5394903700,
|
|
||||||
fe3080Id: 5438797700,
|
|
||||||
fe3090Id: 5438797600,
|
|
||||||
siteLocale: 'pl-pl',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'portugal',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'en_gb',
|
|
||||||
fe2060SuperId: null,
|
|
||||||
fe3080Id: 5438794300,
|
|
||||||
fe3090Id: null,
|
|
||||||
siteLocale: 'en-gb',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'russia',
|
|
||||||
{
|
|
||||||
currency: 'RUB',
|
|
||||||
drLocale: 'ru_ru',
|
|
||||||
fe2060SuperId: null,
|
|
||||||
fe3080Id: null,
|
|
||||||
fe3090Id: null,
|
|
||||||
siteLocale: 'ru-ru',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'spain',
|
|
||||||
{
|
|
||||||
currency: 'EUR',
|
|
||||||
drLocale: 'es_es',
|
|
||||||
fe2060SuperId: 5394903000,
|
|
||||||
fe3080Id: 5438794800,
|
|
||||||
fe3090Id: 5438794700,
|
|
||||||
siteLocale: 'es-es',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'sweden',
|
|
||||||
{
|
|
||||||
currency: 'SEK',
|
|
||||||
drLocale: 'sv_se',
|
|
||||||
fe2060SuperId: 5394903900,
|
|
||||||
fe3080Id: 5438798100,
|
|
||||||
fe3090Id: 5438761600,
|
|
||||||
siteLocale: 'sv-se',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// https://github.com/jef/streetmerchant/issues/407 This fe2080SuperID is for the Shield TV which is out of stock in the US
|
|
||||||
[
|
|
||||||
'usa',
|
|
||||||
{
|
|
||||||
currency: 'USD',
|
|
||||||
drLocale: 'en_us',
|
|
||||||
fe2060SuperId: 5355772500,
|
|
||||||
fe3080Id: 5438481700,
|
|
||||||
fe3090Id: 5438481600,
|
|
||||||
siteLocale: 'en-us',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
export const NvidiaApi: Store = {
|
|
||||||
currency: '',
|
|
||||||
labels: {
|
|
||||||
inStock: {
|
|
||||||
container: 'body',
|
|
||||||
text: ['product_inventory_in_stock'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
links: generateLinks(),
|
|
||||||
name: 'nvidia-api',
|
|
||||||
setupAction: generateSetupAction(),
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import {Store} from './store';
|
||||||
|
|
||||||
|
export const NvidiaDE: Store = {
|
||||||
|
currency: '€',
|
||||||
|
labels: {
|
||||||
|
inStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['In den Einkaufswagen'],
|
||||||
|
},
|
||||||
|
outOfStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['DERZEIT NICHT VERFÜGBAR'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
links: [
|
||||||
|
{
|
||||||
|
brand: 'test:brand',
|
||||||
|
model: 'test:model',
|
||||||
|
series: 'test:series',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/de-de/geforce/graphics-cards/rtx-2060-super/',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3060ti',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/de-de/shop/geforce/gpu/?page=1&limit=9&locale=de-de&category=GPU&gpu=RTX%203060%20Ti&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3070',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/de-de/shop/geforce/gpu/?page=1&limit=9&locale=de-de&category=GPU&gpu=RTX%203070&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3080',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/de-de/shop/geforce/gpu/?page=1&limit=9&locale=de-de&category=GPU&gpu=RTX%203080&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3090',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/de-de/shop/geforce/gpu/?page=1&limit=9&locale=de-de&category=GPU&gpu=RTX%203090&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'nvidia-de',
|
||||||
|
};
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import {Store} from './store';
|
||||||
|
|
||||||
|
export const NvidiaES: Store = {
|
||||||
|
currency: '€',
|
||||||
|
labels: {
|
||||||
|
inStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['Añadir al carrito'],
|
||||||
|
},
|
||||||
|
outOfStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['AGOTADO'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
links: [
|
||||||
|
{
|
||||||
|
brand: 'test:brand',
|
||||||
|
model: 'test:model',
|
||||||
|
series: 'test:series',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/es-es/geforce/graphics-cards/rtx-2060-super/',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3060ti',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/es-es/shop/geforce/gpu/?page=1&limit=9&locale=es-es&category=GPU&gpu=RTX%203060%20Ti&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3070',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/es-es/shop/geforce/gpu/?page=1&limit=9&locale=es-es&category=GPU&gpu=RTX%203070&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3080',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/es-es/shop/geforce/gpu/?page=1&limit=9&locale=es-es&category=GPU&gpu=RTX%203080&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3090',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/es-es/shop/geforce/gpu/?page=1&limit=9&locale=es-es&category=GPU&gpu=RTX%203090&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'nvidia-es',
|
||||||
|
};
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import {Store} from './store';
|
||||||
|
|
||||||
|
export const NvidiaFR: Store = {
|
||||||
|
currency: '€',
|
||||||
|
labels: {
|
||||||
|
inStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['ajouter au panier'],
|
||||||
|
},
|
||||||
|
outOfStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['RUPTURE DE STOCK'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
links: [
|
||||||
|
{
|
||||||
|
brand: 'test:brand',
|
||||||
|
model: 'test:model',
|
||||||
|
series: 'test:series',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/fr-fr/geforce/graphics-cards/rtx-2060-super/',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3060ti',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/fr-fr/shop/geforce/gpu/?page=1&limit=9&locale=fr-fr&category=GPU&gpu=RTX%203060%20Ti&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3070',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/fr-fr/shop/geforce/gpu/?page=1&limit=9&locale=fr-fr&category=GPU&gpu=RTX%203070&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3080',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/fr-fr/shop/geforce/gpu/?page=1&limit=9&locale=fr-fr&category=GPU&gpu=RTX%203080&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3090',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/fr-fr/shop/geforce/gpu/?page=1&limit=9&locale=fr-fr&category=GPU&gpu=RTX%203090&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'nvidia-fr',
|
||||||
|
};
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import {Store} from './store';
|
||||||
|
|
||||||
|
export const NvidiaGB: Store = {
|
||||||
|
currency: '£',
|
||||||
|
labels: {
|
||||||
|
inStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['add to cart'],
|
||||||
|
},
|
||||||
|
outOfStock: {
|
||||||
|
container: '.buy',
|
||||||
|
text: ['out of stock'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
links: [
|
||||||
|
{
|
||||||
|
brand: 'test:brand',
|
||||||
|
model: 'test:model',
|
||||||
|
series: 'test:series',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/en-gb/geforce/graphics-cards/rtx-2060-super/',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3060ti',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/en-gb/shop/geforce/gpu/?page=1&limit=9&locale=en-gb&category=GPU&gpu=RTX%203060%20Ti&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3070',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/en-gb/shop/geforce/gpu/?page=1&limit=9&locale=en-gb&category=GPU&gpu=RTX%203070&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3080',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/en-gb/shop/geforce/gpu/?page=1&limit=9&locale=en-gb&category=GPU&gpu=RTX%203080&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
brand: 'nvidia',
|
||||||
|
model: 'founders edition',
|
||||||
|
series: '3090',
|
||||||
|
url:
|
||||||
|
'https://www.nvidia.com/en-gb/shop/geforce/gpu/?page=1&limit=9&locale=en-gb&category=GPU&gpu=RTX%203090&manufacturer=NVIDIA',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
name: 'nvidia-gb',
|
||||||
|
};
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
import {Store} from './store';
|
|
||||||
|
|
||||||
export const Nvidia: Store = {
|
|
||||||
currency: '$',
|
|
||||||
labels: {
|
|
||||||
captcha: {
|
|
||||||
container: 'body',
|
|
||||||
text: ['are you a human?'],
|
|
||||||
},
|
|
||||||
inStock: [
|
|
||||||
{
|
|
||||||
container: '.main-container',
|
|
||||||
text: ['add to cart'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
container: '.inner',
|
|
||||||
text: ['add to cart'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
links: [
|
|
||||||
{
|
|
||||||
brand: 'test:brand',
|
|
||||||
model: 'test:model',
|
|
||||||
series: 'test:series',
|
|
||||||
url: 'https://www.nvidia.com/en-us/shop/geforce/gpu/',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'test:brand',
|
|
||||||
model: 'test:model',
|
|
||||||
series: 'test:series',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/geforce/graphics-cards/rtx-2060-super/',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
series: '3080',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/shop/geforce/gpu/?page=1&limit=9&locale=en-us&category=GPU&gpu=RTX%203080',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
series: '3080',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/geforce/graphics-cards/30-series/rtx-3080',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
series: '3090',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/shop/geforce/gpu/?page=1&limit=9&locale=en-us&category=GPU&gpu=RTX%203090',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
series: '3090',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/geforce/graphics-cards/30-series/rtx-3090',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
series: '3070',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/shop/geforce/gpu/?page=1&limit=9&locale=en-us&category=GPU&gpu=RTX%203070',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
brand: 'nvidia',
|
|
||||||
model: 'founders edition',
|
|
||||||
series: '3070',
|
|
||||||
url:
|
|
||||||
'https://www.nvidia.com/en-us/geforce/graphics-cards/30-series/rtx-3070',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
name: 'nvidia',
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user