mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 05:17:35 +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`});
|
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') {
|
if (Config.openBrowser === 'true') {
|
||||||
await open(givenUrl);
|
await open(givenUrl);
|
||||||
|
|||||||
@@ -3,42 +3,49 @@ import {Store} from './store';
|
|||||||
export const BestBuy: Store = {
|
export const BestBuy: Store = {
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6432445/cart',
|
||||||
brand: 'asus',
|
brand: 'asus',
|
||||||
model: 'rog strix',
|
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',
|
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']
|
oosLabels: ['sold out', 'coming soon']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6432399/cart',
|
||||||
brand: 'evga',
|
brand: 'evga',
|
||||||
model: 'xc3 black',
|
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',
|
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']
|
oosLabels: ['sold out', 'coming soon']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6432400/cart',
|
||||||
brand: 'evga',
|
brand: 'evga',
|
||||||
model: 'xc3 ultra',
|
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',
|
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']
|
oosLabels: ['sold out', 'coming soon']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6430620/cart',
|
||||||
brand: 'gigabyte',
|
brand: 'gigabyte',
|
||||||
model: 'black',
|
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',
|
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']
|
oosLabels: ['sold out', 'coming soon']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6430621/cart',
|
||||||
brand: 'gigabyte',
|
brand: 'gigabyte',
|
||||||
model: 'eagle',
|
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',
|
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']
|
oosLabels: ['sold out', 'coming soon']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6430175/cart',
|
||||||
brand: 'msi',
|
brand: 'msi',
|
||||||
model: 'ventus 3x',
|
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',
|
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']
|
oosLabels: ['sold out', 'coming soon']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
cartUrl: 'https://api.bestbuy.com/click/-/6429440/cart',
|
||||||
brand: 'nvidia',
|
brand: 'nvidia',
|
||||||
model: 'founder edition',
|
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',
|
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 {
|
interface Link {
|
||||||
|
cartUrl?: string;
|
||||||
brand: string;
|
brand: string;
|
||||||
model: string;
|
model: string;
|
||||||
url: string;
|
url: string;
|
||||||
@@ -7,7 +8,6 @@ interface Link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Store {
|
export interface Store {
|
||||||
cartUrl?: string;
|
|
||||||
links: Link[];
|
links: Link[];
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user