-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
microcenter.ts
110 lines (106 loc) 路 3.24 KB
/
microcenter.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import {Link, Store} from './store';
import {config} from '../../config';
import {logger} from '../../logger';
const microCenterLocations = config.store.microCenterLocation;
const microCenterLocationToId: Map<string, string> = new Map([
['web', '029'],
['brooklyn', '115'],
['brentwood', '095'],
['cambridge', '121'],
['chicago', '151'],
['columbus', '141'],
['dallas', '131'],
['denver', '181'],
['duluth', '065'],
['fairfax', '081'],
['flushing', '145'],
['houston', '155'],
['madison-heights', '055'],
['marietta', '041'],
['mayfield-heights', '051'],
['north-jersey', '075'],
['overland-park', '191'],
['parkville', '125'],
['rockville', '085'],
['sharonville', '071'],
['st-davids', '061'],
['st-louis-park', '045'],
['tustin', '101'],
['westbury', '171'],
['westmont', '025'],
['yonkers', '105']
]);
let links: Link[] = [];
let storeId: string;
for (const microCenterLocation of microCenterLocations) {
if (microCenterLocationToId.get(microCenterLocation) === undefined) {
const logString = `No MicroCenter location named ${microCenterLocation}, skipping.`;
logger.warn(logString);
} else {
storeId = microCenterLocationToId.get(microCenterLocation)!;
links = links.concat([
{
brand: 'test:brand',
model: 'test:model',
series: 'test:series',
url: `https://www.microcenter.com/product/618433/evga-geforce-rtx-2060-ko-ultra-overclocked-dual-fan-6gb-gddr6-pcie-30-graphics-card/?storeid=${storeId}`
},
{
brand: 'evga',
model: 'xc3 ultra',
series: '3080',
url: `https://www.microcenter.com/product/628344/evga-geforce-rtx-3080-xc3-ultra-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
},
{
brand: 'evga',
model: 'ftw3 ultra',
series: '3080',
url: `https://www.microcenter.com/product/628346/evga-geforce-rtx-3080-ftw3-ultra-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
},
{
brand: 'msi',
model: 'ventus 3x',
series: '3080',
url: `https://www.microcenter.com/product/628331/msi-geforce-rtx-3080-ventus-3x-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
},
{
brand: 'asus',
model: 'tuf',
series: '3080',
url: `https://www.microcenter.com/product/628303/asus-geforce-rtx-3080-tuf-gaming-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
},
{
brand: 'msi',
model: 'gaming x trio',
series: '3080',
url: `https://www.microcenter.com/product/628330/msi-geforce-rtx-3080-gaming-x-trio-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
},
{
brand: 'evga',
model: 'xc3 black',
series: '3080',
url: `https://www.microcenter.com/product/628340/evga-geforce-rtx-3080-xc3-black-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
},
{
brand: 'zotac',
model: 'trinity',
series: '3080',
url: `https://www.microcenter.com/product/628607/zotac-geforce-rtx-3080-trinity-overclocked-triple-fan-10gb-gddr6x-pcie-40-graphics-card/?storeid=${storeId}`
}
]);
}
}
export const MicroCenter: Store = {
labels: {
inStock: {
container: '#cart-options',
text: ['in stock']
},
maxPrice: {
container: 'span[id="pricing"]',
euroFormat: false
}
},
links,
name: 'microcenter'
};