mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 14:37:41 +00:00
refactor: move cartUrl from Store to Link (#87)
This commit is contained in:
+1
-1
@@ -70,7 +70,7 @@ export async function lookup(browser: puppeteer.Browser, store: Store) {
|
||||
await page.screenshot({path: `success-${Date.now()}.png`});
|
||||
}
|
||||
|
||||
const givenUrl = store.cartUrl ? store.cartUrl : link.url;
|
||||
const givenUrl = link.cartUrl ? link.cartUrl : link.url;
|
||||
|
||||
if (Config.openBrowser === 'true') {
|
||||
await open(givenUrl);
|
||||
|
||||
@@ -3,42 +3,49 @@ import {Store} from './store';
|
||||
export const BestBuy: Store = {
|
||||
links: [
|
||||
{
|
||||
cartUrl: 'https://api.bestbuy.com/click/-/6432445/cart',
|
||||
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/-/6432399/cart',
|
||||
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/-/6432400/cart',
|
||||
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/-/6430620/cart',
|
||||
brand: 'gigabyte',
|
||||
model: 'black',
|
||||
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/-/6430621/cart',
|
||||
brand: 'gigabyte',
|
||||
model: 'eagle',
|
||||
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/-/6430175/cart',
|
||||
brand: 'msi',
|
||||
model: 'ventus 3x',
|
||||
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: 'founder 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',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
interface Link {
|
||||
cartUrl?: string;
|
||||
brand: string;
|
||||
model: string;
|
||||
url: string;
|
||||
@@ -7,7 +8,6 @@ interface Link {
|
||||
}
|
||||
|
||||
export interface Store {
|
||||
cartUrl?: string;
|
||||
links: Link[];
|
||||
name: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user