mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 12:17:37 +00:00
feat(store): add bannedSeller label for stores (#173)
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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'
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ export const BAndH: Store = {
|
||||
|
||||
],
|
||||
labels: {
|
||||
outOfStock: ['notify when available']
|
||||
outOfStock: ['notify when available', 'try varying your search terms']
|
||||
},
|
||||
name: 'bandh'
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface Link {
|
||||
export interface Labels {
|
||||
outOfStock: string[];
|
||||
captcha?: string[];
|
||||
bannedSeller?: string[];
|
||||
}
|
||||
|
||||
export interface Store {
|
||||
|
||||
Reference in New Issue
Block a user