Skip to content

Commit

Permalink
feat(store): add argos with ps5
Browse files Browse the repository at this point in the history
Updated env-example
Add max price for test series

Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
  • Loading branch information
jef committed Dec 2, 2020
1 parent 29478bf commit b2f5c1a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env-example
Expand Up @@ -17,7 +17,7 @@ HEADLESS=""
IN_STOCK_WAIT_TIME=""
LOG_LEVEL=""
LOW_BANDWIDTH=""
MAX_PRICE_SERIES_3060=""
MAX_PRICE_SERIES_3060TI=""
MAX_PRICE_SERIES_3070=""
MAX_PRICE_SERIES_3080=""
MAX_PRICE_SERIES_3090=""
Expand All @@ -31,6 +31,7 @@ MAX_PRICE_SERIES_RYZEN5900=""
MAX_PRICE_SERIES_RYZEN5950=""
MAX_PRICE_SERIES_SONYPS5C=""
MAX_PRICE_SERIES_SONYPS5DE=""
MAX_PRICE_SERIES_TEST=""
MICROCENTER_LOCATION=""
MQTT_BROKER_ADDRESS=""
MQTT_BROKER_PORT=""
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -125,6 +125,7 @@ environment variables are **optional**._
| `MAX_PRICE_SERIES_RYZEN5950` | Maximum price allowed for a match, applies AMD 5950 series cpus | Default: leave empty for no limit, otherwise enter a price (enter whole dollar amounts only, avoid use of: dollar symbols, commas, and periods.) e.g.: `1234` - CPUs above `1234` will be skipped. |
| `MAX_PRICE_SERIES_SONYPS5C` | Maximum price allowed for a match, applies PS5 console | Default: leave empty for no limit, otherwise enter a price (enter whole dollar amounts only, avoid use of: dollar symbols, commas, and periods.) e.g.: `1234` - PS5 above `1234` will be skipped. |
| `MAX_PRICE_SERIES_SONYPS5DE` | Maximum price allowed for a match, applies PS5 digital edition | Default: leave empty for no limit, otherwise enter a price (enter whole dollar amounts only, avoid use of: dollar symbols, commas, and periods.) e.g.: `1234` - PS5 above `1234` will be skipped. |
| `MAX_PRICE_SERIES_TEST` | Maximum price allowed for a match, applies `test:series` | Default: leave empty for no limit, otherwise enter a price (enter whole dollar amounts only, avoid use of: dollar symbols, commas, and periods.) e.g.: `1234` - PS5 above `1234` will be skipped. |
| `MICROCENTER_LOCATION` | Specific MicroCenter location(s) to search | Comma separated, e.g.: `marietta,duluth`, default: `web` |
| `NVIDIA_ADD_TO_CART_ATTEMPTS` | The maximum number of times the `nvidia-api` add to cart feature will be attempted before failing | Default: `10` |
| `NVIDIA_SESSION_TTL` | The time in milliseconds to keep the cart active while using `nvidia-api` | Default: `60000` |
Expand Down Expand Up @@ -156,6 +157,7 @@ environment variables are **optional**._
| AMD (DE) | `amd-de`|
| AMD (IT) | `amd-it`|
| AntOnline | `antonline`|
| Argos (UK) | `argos`|
| Aria PC (UK) | `aria`|
| ARLT (DE) | `arlt`|
| ASUS | `asus` |
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Expand Up @@ -322,7 +322,7 @@ const store = {
sf: envOrNumber(process.env.MAX_PRICE_SERIES_CORSAIR_SF),
sonyps5c: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5C),
sonyps5de: envOrNumber(process.env.MAX_PRICE_SERIES_SONYPS5DE),
'test:series': -1,
'test:series': envOrNumber(process.env.MAX_PRICE_SERIES_TEST),
xboxss: -1,
xboxsx: -1
}
Expand Down
34 changes: 34 additions & 0 deletions src/store/model/argos.ts
@@ -0,0 +1,34 @@
import {Store} from './store';

export const Argos: Store = {
labels: {
inStock: {
container: 'button[data-test="add-to-trolley-button-button"',
text: ['to trolley']
},
maxPrice: {
container: 'li[itemprop="price"]'
}
},
links: [
{
brand: 'test:brand',
model: 'test:model',
series: 'test:series',
url: 'https://www.argos.co.uk/product/5718469'
},
{
brand: 'asus',
model: 'ps5 console',
series: 'sonyps5c',
url: 'https://www.argos.co.uk/product/6795199'
},
{
brand: 'sony',
model: 'ps5 digital',
series: 'sonyps5de',
url: 'https://www.argos.co.uk/product/6795151'
}
],
name: 'argos'
};
2 changes: 2 additions & 0 deletions src/store/model/index.ts
Expand Up @@ -15,6 +15,7 @@ import {AmdCa} from './amd-ca';
import {AmdDe} from './amd-de';
import {AmdIt} from './amd-it';
import {AntOnline} from './antonline';
import {Argos} from './argos';
import {Aria} from './aria';
import {Arlt} from './arlt';
import {Asus} from './asus';
Expand Down Expand Up @@ -93,6 +94,7 @@ export const storeList = new Map([
[AmdDe.name, AmdDe],
[AmdIt.name, AmdIt],
[AntOnline.name, AntOnline],
[Argos.name, Argos],
[Aria.name, Aria],
[Arlt.name, Arlt],
[Asus.name, Asus],
Expand Down
2 changes: 1 addition & 1 deletion src/store/model/store.ts
@@ -1,4 +1,4 @@
import {Browser, BrowserContext, LoadEvent} from 'puppeteer';
import {Browser, LoadEvent} from 'puppeteer';

export type Element = {
container?: string;
Expand Down

0 comments on commit b2f5c1a

Please sign in to comment.