mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 13:27:38 +00:00
feat: newegg realtime api (#664)
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
@@ -192,6 +192,11 @@ async function lookupCardInStock(store: Store, page: Page, link: Link) {
|
||||
}
|
||||
}
|
||||
|
||||
// Do API inventory validation in realtime (no cache) if available
|
||||
if (store.realTimeInventoryLookup !== undefined && link.itemNumber !== undefined) {
|
||||
return store.realTimeInventoryLookup(link.itemNumber);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {Store} from './store';
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
export const Newegg: Store = {
|
||||
labels: {
|
||||
@@ -18,13 +19,15 @@ export const Newegg: Store = {
|
||||
links: [
|
||||
{
|
||||
brand: 'test:brand',
|
||||
itemNumber: '14-500-495',
|
||||
model: 'test:model',
|
||||
series: 'test:series',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-2060-06g-p4-2066-kr/p/N82E16814487488'
|
||||
url: 'https://www.newegg.com/zotac-geforce-rtx-2060-zt-t20600k-10m/p/N82E16814500495'
|
||||
},
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126453',
|
||||
itemNumber: '14-126-453',
|
||||
model: 'tuf',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3080-tuf-rtx3080-10g-gaming/p/N82E16814126453'
|
||||
@@ -32,6 +35,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487518',
|
||||
itemNumber: '14-487-518',
|
||||
model: 'ftw3 ultra',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3897-kr/p/N82E16814487518'
|
||||
@@ -39,6 +43,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487519',
|
||||
itemNumber: '14-487-519',
|
||||
model: 'ftw3',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3895-kr/p/N82E16814487519'
|
||||
@@ -46,6 +51,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487522',
|
||||
itemNumber: '14-487-522',
|
||||
model: 'xc3 black',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3881-kr/p/N82E16814487522'
|
||||
@@ -53,6 +59,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487521',
|
||||
itemNumber: '14-487-521',
|
||||
model: 'xc3',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3080-10g-p5-3883-kr/p/N82E16814487521'
|
||||
@@ -60,6 +67,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137600',
|
||||
itemNumber: '14-137-600',
|
||||
model: 'ventus 3x',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-ventus-3x-10g/p/N82E16814137600'
|
||||
@@ -67,6 +75,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137598',
|
||||
itemNumber: '14-137-598',
|
||||
model: 'ventus 3x oc',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-ventus-3x-10g-oc/p/N82E16814137598'
|
||||
@@ -74,6 +83,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137597',
|
||||
itemNumber: '14-137-597',
|
||||
model: 'gaming x trio',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3080-rtx-3080-gaming-x-trio-10g/p/N82E16814137597'
|
||||
@@ -81,6 +91,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932329',
|
||||
itemNumber: '149-32-329',
|
||||
model: 'gaming oc',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080gaming-oc-10gd/p/N82E16814932329'
|
||||
@@ -88,6 +99,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932330',
|
||||
itemNumber: '149-32-330',
|
||||
model: 'eagle oc',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080eagle-oc-10gd/p/N82E16814932330'
|
||||
@@ -95,6 +107,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932336',
|
||||
itemNumber: '14-932-336',
|
||||
model: 'aorus master',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3080-gv-n3080aorus-m-10gd/p/N82E16814932336'
|
||||
@@ -102,6 +115,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'zotac',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814500502',
|
||||
itemNumber: '14-950-502',
|
||||
model: 'trinity',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/zotac-geforce-rtx-3080-zt-a30800d-10p/p/N82E16814500502'
|
||||
@@ -109,6 +123,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126457',
|
||||
itemNumber: '14-126-457',
|
||||
model: 'rog strix',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3080-rog-strix-rtx3080-o10g-gaming/p/N82E16814126457'
|
||||
@@ -116,6 +131,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126452',
|
||||
itemNumber: '14-126-452',
|
||||
model: 'tuf oc',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3080-tuf-rtx3080-o10g-gaming/p/N82E16814126452'
|
||||
@@ -123,6 +139,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'zotac',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814500504',
|
||||
itemNumber: '14-500-504',
|
||||
model: 'trinity oc',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/zotac-geforce-rtx-3080-zt-t30800j-10p/p/N82E16814500504'
|
||||
@@ -130,6 +147,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'pny',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814133809',
|
||||
itemNumber: '14-133-809',
|
||||
model: 'xlr8 rgb',
|
||||
series: '3080',
|
||||
url: 'https://www.newegg.com/pny-geforce-rtx-3080-vcg308010tfxppb/p/N82E16814133809'
|
||||
@@ -137,6 +155,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126455',
|
||||
itemNumber: '14-126-455',
|
||||
model: 'tuf',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3090-tuf-rtx3090-24g-gaming/p/N82E16814126455'
|
||||
@@ -144,6 +163,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126456',
|
||||
itemNumber: '14-126-456',
|
||||
model: 'rog strix',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3090-rog-strix-rtx3090-o24g-gaming/p/N82E16814126456'
|
||||
@@ -151,6 +171,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137595',
|
||||
itemNumber: '14-137-595',
|
||||
model: 'gaming x trio',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3090-rtx-3090-gaming-x-trio-24g/p/N82E16814137595'
|
||||
@@ -158,6 +179,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137596',
|
||||
itemNumber: '14-137-596',
|
||||
model: 'ventus 3x oc',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3090-rtx-3090-ventus-3x-24g-oc/p/N82E16814137596'
|
||||
@@ -165,6 +187,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'zotac',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814500503',
|
||||
itemNumber: '14-500-503',
|
||||
model: 'trinity',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/zotac-geforce-rtx-3090-zt-a30900d-10p/p/N82E16814500503'
|
||||
@@ -172,6 +195,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137599',
|
||||
itemNumber: '14-137-599',
|
||||
model: 'ventus 3x',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3090-rtx-3090-ventus-3x-24g/p/N82E16814137599'
|
||||
@@ -179,6 +203,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487525',
|
||||
itemNumber: '14-487-525',
|
||||
model: 'ftw3',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3090-24g-p5-3985-kr/p/N82E16814487525'
|
||||
@@ -186,6 +211,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487524',
|
||||
itemNumber: '14-487-524',
|
||||
model: 'xc3 ultra',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3090-24g-p5-3975-kr/p/N82E16814487524'
|
||||
@@ -193,6 +219,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487526',
|
||||
itemNumber: '14-487-526',
|
||||
model: 'ftw3 ultra',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3090-24g-p5-3987-kr/p/N82E16814487526'
|
||||
@@ -200,6 +227,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487527',
|
||||
itemNumber: '14-487-527',
|
||||
model: 'xc3 black',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3090-24g-p5-3971-kr/p/N82E16814487527'
|
||||
@@ -207,6 +235,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487523',
|
||||
itemNumber: '14-487-523',
|
||||
model: 'xc3',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3090-24g-p5-3973-kr/p/N82E16814487523'
|
||||
@@ -214,6 +243,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932327',
|
||||
itemNumber: '14-932-327',
|
||||
model: 'gaming',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3090-gv-n3090gaming-oc-24gd/p/N82E16814932327'
|
||||
@@ -221,6 +251,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932328',
|
||||
itemNumber: '14-932-328',
|
||||
model: 'eagle',
|
||||
series: '3090',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3090-gv-n3090eagle-oc-24gd/p/N82E16814932328'
|
||||
@@ -228,6 +259,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137601',
|
||||
itemNumber: '14-137-601',
|
||||
model: 'ventus 3x oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3070-rtx-3070-ventus-3x-oc/p/N82E16814137601'
|
||||
@@ -235,6 +267,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137602',
|
||||
itemNumber: '14-137-602',
|
||||
model: 'ventus 2x oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3070-rtx-3070-ventus-2x-oc/p/N82E16814137602'
|
||||
@@ -242,6 +275,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'msi',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814137603',
|
||||
itemNumber: '14-137-603',
|
||||
model: 'gaming x trio',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/msi-geforce-rtx-3070-rtx-3070-gaming-x-trio/p/N82E16814137603'
|
||||
@@ -249,6 +283,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932360',
|
||||
itemNumber: '14-932-360',
|
||||
model: 'vision oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3070-gv-n3070vision-oc-8gd/p/N82E16814932360'
|
||||
@@ -256,6 +291,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126459',
|
||||
itemNumber: '14-126-459',
|
||||
model: 'dual oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3070-dual-rtx3070-o8g/p/N82E16814126459'
|
||||
@@ -263,6 +299,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126458',
|
||||
itemNumber: '14-126-458',
|
||||
model: 'rog strix',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3070-rog-strix-rtx3070-o8g-gaming/p/N82E16814126458'
|
||||
@@ -270,6 +307,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'zotac',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814500501',
|
||||
itemNumber: '14-500-501',
|
||||
model: 'twin edge',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/zotac-geforce-rtx-3070-zt-a30700e-10p/p/N82E16814500501'
|
||||
@@ -277,6 +315,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'zotac',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814500505',
|
||||
itemNumber: '14-500-505',
|
||||
model: 'twin edge oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/zotac-geforce-rtx-3070-zt-a30700h-10p/p/N82E16814500505'
|
||||
@@ -284,6 +323,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932342',
|
||||
itemNumber: '14-932-342',
|
||||
model: 'gaming oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3070-gv-n3070gaming-oc-8gd/p/N82E16814932342'
|
||||
@@ -291,6 +331,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487532',
|
||||
itemNumber: '14-487-532',
|
||||
model: 'ftw3 ultra',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3070-08g-p5-3767-kr/p/N82E16814487532'
|
||||
@@ -298,6 +339,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487530',
|
||||
itemNumber: '14-487-530',
|
||||
model: 'xc3 ultra',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3070-08g-p5-3755-kr/p/N82E16814487530'
|
||||
@@ -305,6 +347,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487528',
|
||||
itemNumber: '14-487-528',
|
||||
model: 'xc3 black',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3070-08g-p5-3751-kr/p/N82E16814487528'
|
||||
@@ -312,6 +355,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932343',
|
||||
itemNumber: '14-932-343',
|
||||
model: 'eagle oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3070-gv-n3070eagle-oc-8gd/p/N82E16814932343'
|
||||
@@ -319,6 +363,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932344',
|
||||
itemNumber: '14-932-344',
|
||||
model: 'eagle',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3070-gv-n3070eagle-8gd/p/N82E16814932344'
|
||||
@@ -326,6 +371,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487529',
|
||||
itemNumber: '14-487-529',
|
||||
model: 'xc3',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3070-08g-p5-3753-kr/p/N82E16814487529'
|
||||
@@ -333,6 +379,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126460',
|
||||
itemNumber: '14-126-460',
|
||||
model: 'dual',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3070-dual-rtx3070-8g/p/N82E16814126460'
|
||||
@@ -340,6 +387,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'gigabyte',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814932359',
|
||||
itemNumber: '14-932-359',
|
||||
model: 'aorus master',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/gigabyte-geforce-rtx-3070-gv-n3070aorus-m-8gd/p/N82E16814932359'
|
||||
@@ -347,6 +395,7 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'evga',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814487531',
|
||||
itemNumber: '14-487-531',
|
||||
model: 'ftw3',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/evga-geforce-rtx-3070-08g-p5-3765-kr/p/N82E16814487531'
|
||||
@@ -354,10 +403,17 @@ export const Newegg: Store = {
|
||||
{
|
||||
brand: 'asus',
|
||||
cartUrl: 'https://secure.newegg.com/Shopping/AddtoCart.aspx?Submit=ADD&ItemList=N82E16814126461',
|
||||
itemNumber: '14-126-461',
|
||||
model: 'tuf oc',
|
||||
series: '3070',
|
||||
url: 'https://www.newegg.com/asus-geforce-rtx-3070-tuf-rtx3070-o8g-gaming/p/N82E16814126461'
|
||||
}
|
||||
],
|
||||
name: 'newegg'
|
||||
name: 'newegg',
|
||||
realTimeInventoryLookup: async (itemNumber: string) => {
|
||||
const request_url = 'https://www.newegg.com/product/api/ProductRealtime?ItemNumber=' + itemNumber;
|
||||
const response = await fetch(request_url);
|
||||
const response_json = await response.json();
|
||||
return response_json.MainItem !== undefined && response_json.MainItem.Instock === true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,6 +14,7 @@ export type Series = 'test:series' | '3070' | '3080' | '3090';
|
||||
|
||||
export type Link = {
|
||||
brand: 'test:brand' | 'asus' | 'evga' | 'gainward' | 'gigabyte' | 'inno3d' | 'kfa2' | 'msi' | 'nvidia' | 'palit' | 'pny' | 'zotac';
|
||||
itemNumber?: string;
|
||||
series: Series;
|
||||
model: string;
|
||||
url: string;
|
||||
@@ -36,6 +37,7 @@ export type Labels = {
|
||||
export type StatusCodeRangeArray = Array<(number | [number, number])>;
|
||||
|
||||
export type Store = {
|
||||
realTimeInventoryLookup?: (itemNumber: string) => Promise<boolean>;
|
||||
/**
|
||||
* The range of status codes which will trigger backoff, i.e. an increasing
|
||||
* delay between requests. Setting an empty array will disable the feature.
|
||||
|
||||
Reference in New Issue
Block a user