Skip to content

Commit

Permalink
feat(store): microcenter (jef#39)
Browse files Browse the repository at this point in the history
Co-authored-by: Ion Caza <[email protected]>
Co-authored-by: Jef LeCompte <[email protected]>
  • Loading branch information
3 people authored Sep 19, 2020
1 parent faad3e6 commit edf17e9
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/
.vs/
.vscode/
build/
node_modules/

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ First, you're going to need to copy the `.env.example` to `.env`. The current op
| Amazon | `amazon`|
| B&H | `bandh`|
| EVGA | `evga`|
| Micro Center | `microcenter`|
| Newegg | `newegg`|
| Nvidia | `nvidia`|

Expand Down
30 changes: 8 additions & 22 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,25 @@ import {Evga} from './evga';
import {NewEgg} from './newegg';
import {Nvidia} from './nvidia';
import {Amazon} from './amazon';
import {MicroCenter} from './microcenter';
import {Config} from '../config';

const list = new Map([
const masterList = new Map([
['amazon', Amazon],
['bestbuy', BestBuy],
['bandh', BAndH],
['evga', Evga],
['amazon', Amazon],
['microcenter', MicroCenter],
['newegg', NewEgg],
['nvidia', Nvidia]
]);

if (!Config.stores.toLowerCase().includes('bestbuy')) {
list.delete('bestbuy');
}

if (!Config.stores.toLowerCase().includes('bandh')) {
list.delete('bandh');
}

if (!Config.stores.toLowerCase().includes('evga')) {
list.delete('evga');
}
const list = new Map();

if (!Config.stores.toLowerCase().includes('amazon')) {
list.delete('amazon');
}

if (!Config.stores.toLowerCase().includes('newegg')) {
list.delete('newegg');
}
const storeArray = Config.stores.split(',');

if (!Config.stores.toLowerCase().includes('nvidia')) {
list.delete('nvidia');
for (const name of storeArray) {
list.set(name, masterList.get(name));
}

export const Stores = Array.from(list.values());
Expand Down
44 changes: 44 additions & 0 deletions src/store/microcenter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {Store} from './store';

export const MicroCenter: Store = {
cartUrl: '',
links: [
{
brand: 'evga',
model: 'xc3 ultra gaming',
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']
},
{
brand: 'msi',
model: 'ventus 3x overclocked',
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']
},
{
brand: 'asus',
model: 'tuf gaming',
url: 'https://www.microcenter.com/product/628303/asus-geforce-rtx-3080-tuf-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
oosLabels: ['sold out']
},
{
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']
},
{
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']
},
{
brand: 'zotac',
model: 'trinity overclocked',
url: 'https://www.microcenter.com/product/628607/zotac-geforce-rtx-3080-trinity-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card',
oosLabels: ['sold out']
}
],
name: 'microcenter'
};

0 comments on commit edf17e9

Please sign in to comment.