feat(store): add bannedSeller label for stores (#173)

Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
George
2020-09-21 15:54:40 -07:00
committed by GitHub
parent 5f628d2c12
commit 71c6774511
4 changed files with 6 additions and 2 deletions
+2
View File
@@ -75,6 +75,8 @@ async function lookup(browser: Browser, store: Store) {
if (includesLabels(textContent, store.labels.outOfStock)) {
Logger.info(`✖ [${store.name}] still out of stock: ${graphicsCard}`);
} else if (store.labels.bannedSeller && includesLabels(textContent, store.labels.bannedSeller)) {
Logger.warn(`✖ [${store.name}] banned seller detected: ${graphicsCard}. skipping...`);
} else if (store.labels.captcha && includesLabels(textContent, store.labels.captcha)) {
Logger.warn(`✖ [${store.name}] CAPTCHA from: ${graphicsCard}. Waiting for a bit with this store...`);
await delay(getSleepTime());
+2 -1
View File
@@ -95,7 +95,8 @@ export const Amazon: Store = {
],
labels: {
captcha: ['enter the characters you see below'],
outOfStock: ['currently unavailable', 'available from these sellers']
outOfStock: ['currently unavailable', 'available from these sellers'],
bannedSeller: ['sports authentics', 'raccoon capitalist', 'gigaparts']
},
name: 'amazon'
};
+1 -1
View File
@@ -59,7 +59,7 @@ export const BAndH: Store = {
],
labels: {
outOfStock: ['notify when available']
outOfStock: ['notify when available', 'try varying your search terms']
},
name: 'bandh'
};
+1
View File
@@ -13,6 +13,7 @@ export interface Link {
export interface Labels {
outOfStock: string[];
captcha?: string[];
bannedSeller?: string[];
}
export interface Store {