Skip to content

Commit

Permalink
Merge branch 'main' into develop-newegg-realtime-api-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jef committed Nov 3, 2020
2 parents 9cc163b + 601742c commit 331f633
Show file tree
Hide file tree
Showing 8 changed files with 14,331 additions and 140 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nvidia-snatcher [![ci](https://github.com/jef/nvidia-snatcher/workflows/ci/badge.svg)](https://github.com/jef/nvidia-snatcher/actions?query=workflow%3Aci)
# nvidia-snatcher [![ci](https://github.com/jef/nvidia-snatcher/workflows/ci/badge.svg)](https://github.com/jef/nvidia-snatcher/actions?query=workflow%3Aci) [![chat on freenode](https://img.shields.io/badge/chat-on%20freenode-blue)](https://kiwiirc.com/nextclient/irc.kiwiirc.com/?nick=kiwi_?#streetmerchant)

[FAQ](#FAQ) | [Issues](https://github.com/jef/nvidia-snatcher/issues)
| [Wiki](https://github.com/jef/nvidia-snatcher/wiki)
Expand Down
14,305 changes: 14,174 additions & 131 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"mqtt": "^4.2.4",
"node-fetch": "^2.6.1",
"node-notifier": "^8.0.0",
"node-pagerduty": "^1.3.4",
"node-pagerduty": "^1.3.5",
"nodemailer": "^6.4.14",
"open": "^7.3.0",
"play-sound": "^1.1.3",
"puppeteer": "^5.4.1",
"puppeteer-extra": "^3.1.15",
"puppeteer-extra-plugin-adblocker": "^2.11.7",
"puppeteer-extra-plugin-adblocker": "^2.11.8",
"puppeteer-extra-plugin-block-resources": "^2.2.7",
"puppeteer-extra-plugin-stealth": "^2.6.3",
"puppeteer-extra-plugin-stealth": "^2.6.5",
"pushover-notifications": "^1.2.2",
"twilio": "^3.50.0",
"twitch": "^4.2.7",
Expand All @@ -57,7 +57,7 @@
"@types/node-fetch": "^2.5.7",
"@types/node-notifier": "^8.0.0",
"@types/nodemailer": "^6.4.0",
"@types/puppeteer": "^3.0.2",
"@types/puppeteer": "^3.0.4",
"@types/twitter": "^1.7.0",
"husky": "^4.3.0",
"nodemon": "^2.0.6",
Expand Down
2 changes: 1 addition & 1 deletion src/store/model/helpers/nvidia-cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class NvidiaCart {
}

public get regionInfo(): NvidiaRegionInfo {
const country = config.store.country;
const country = config.store.country.toLowerCase();
const regionInfo = regionInfos.get(country);
if (!regionInfo) {
throw new Error(`Unknown country ${country}`);
Expand Down
2 changes: 1 addition & 1 deletion src/store/model/helpers/nvidia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {config} from '../../../config';
import {timestampUrlParameter} from '../../timestamp-url-parameter';

function getRegionInfo(): NvidiaRegionInfo {
let country = config.store.country;
let country = config.store.country.toLowerCase();
if (!regionInfos.has(country)) {
country = 'usa';
}
Expand Down
14 changes: 14 additions & 0 deletions src/store/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,27 @@ function printConfig() {
}
}

function warnIfStoreDeprecated(store: Store) {
switch (store.name) {
case 'nvidia':
case 'nvidia-api':
logger.warn(`${store.name} is deprecated in favor of bestbuy`);
break;
case 'evga':
logger.warn(`${store.name} is deprecated since they only support queuing`);
break;
default:
}
}

export function updateStores() {
stores.clear();

for (const storeData of config.store.stores) {
const store = storeList.get(storeData.name);

if (store) {
warnIfStoreDeprecated(store);
stores.set(storeData.name, store);
store.minPageSleep = storeData.minPageSleep;
store.maxPageSleep = storeData.maxPageSleep;
Expand Down
80 changes: 78 additions & 2 deletions src/store/model/mediamarkt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ export const Mediamarkt: Store = {
container: 'span[font-family="price"]',
euroFormat: false
},
outOfStock: {
outOfStock: [{
container: '#root',
text: ['dieser artikel ist aktuell nicht verfügbar.']
}
},
{
container: '#root',
text: ['leider keine Lieferung möglich']
}]
},
links: [
{
Expand All @@ -18,30 +22,102 @@ export const Mediamarkt: Store = {
series: 'test:series',
url: 'https://www.mediamarkt.de/de/product/-2592355.html'
},
{
brand: 'asus',
model: 'rog strix',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691243.html'
},
{
brand: 'asus',
model: 'rog strix oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691244.html'
},
{
brand: 'asus',
model: 'dual',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691245.html'
},
{
brand: 'asus',
model: 'dual oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691246.html'
},
{
brand: 'asus',
model: 'tuf oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691247.html'
},
{
brand: 'gigabyte',
model: 'gaming oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691439.html'
},
{
brand: 'gigabyte',
model: 'eagle oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691444.html'
},
{
brand: 'gigabyte',
model: 'aorus master',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2696163.html'
},
{
brand: 'gigabyte',
model: 'vision oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2696164.html'
},
{
brand: 'msi',
model: 'gaming x trio',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2694894.html'
},
{
brand: 'msi',
model: 'ventus 3x oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2694896.html'
},
{
brand: 'msi',
model: 'ventus 2x oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2694898.html'
},
{
brand: 'inno3d',
model: 'ichill x3',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2695942.html'
},
{
brand: 'inno3d',
model: 'ichill x4',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2695941.html'
},
{
brand: 'zotac',
model: 'twin edge',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2691365.html'
},
{
brand: 'zotac',
model: 'twin edge oc',
series: '3070',
url: 'https://www.mediamarkt.de/de/product/-2695671.html'
},
{
brand: 'asus',
model: 'rog strix',
Expand Down
58 changes: 58 additions & 0 deletions src/store/model/notebooksbilliger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const Notebooksbilliger: Store = {
container: '.soldOut',
text: ['dieses produkt ist leider ausverkauft.']
},
{
container: '.just_inStore',
text: ['dieses Produkt kann nur in unseren unten genannten Stores gekauft werden.']
},
{
container: '#product_error_text',
text: ['leider ist dieser artikel nicht mehr verfügbar.']
Expand All @@ -36,12 +40,66 @@ export const Notebooksbilliger: Store = {
series: '3070',
url: 'https://www.notebooksbilliger.de/inno3d+geforce+rtx+3070+ichill+x3+grafikkarte+684162'
},
{
brand: 'inno3d',
model: 'twin x2',
series: '3070',
url: 'https://www.notebooksbilliger.de/inno3d+geforce+rtx+3070+twin+x2+grafikkarte+685496'
},
{
brand: 'inno3d',
model: 'twin x2 oc',
series: '3070',
url: 'https://www.notebooksbilliger.de/inno3d+geforce+rtx+3070+twin+x2+oc+grafikkarte+685500'
},
{
brand: 'nvidia',
model: 'founders edition',
series: '3070',
url: 'https://www.notebooksbilliger.de/nvidia+geforce+rtx+3070+founders+edition+685357'
},
{
brand: 'gainward',
model: 'phoenix',
series: '3070',
url: 'https://www.notebooksbilliger.de/gainward+geforce+rtx+3070+phoenix+8gb+gddr6+grafikkarte+685073'
},
{
brand: 'gainward',
model: 'phoenix gs',
series: '3070',
url: 'https://www.notebooksbilliger.de/gainward+geforce+rtx+3070+phoenix+gs+8gb+gddr6+grafikkarte+681575'
},
{
brand: 'pny',
model: 'uprising',
series: '3070',
url: 'https://www.notebooksbilliger.de/pny+geforce+rtx+3070+8gb+uprising+dual+fan+edition+grafikkarte+685520'
},
{
brand: 'pny',
model: 'xlr8 rgb',
series: '3070',
url: 'https://www.notebooksbilliger.de/pny+geforce+rtx+3070+8gb+xlr8+gaming+revel+epic+x+rgb+685560'
},
{
brand: 'asus',
model: 'tuf',
series: '3070',
url: 'https://www.notebooksbilliger.de/asus+tuf+gaming+geforce+rtx+3070+8gb+grafikkarte+685524'
},
{
brand: 'zotac',
model: 'twin edge',
series: '3070',
url: 'https://www.notebooksbilliger.de/zotac+gaming+geforce+rtx+3070+twin+edge+8gb+gddr6+grafikkarte+677561'
},
{
brand: 'zotac',
model: 'twin edge oc',
series: '3070',
url: 'https://www.notebooksbilliger.de/zotac+gaming+geforce+rtx+3070+twin+edge+oc+8gb+gddr6+grafikkarte+684216'
},
{
brand: 'gainward',
model: 'phoenix gs',
Expand Down

0 comments on commit 331f633

Please sign in to comment.