General¶
Adding a store¶
Note
This is subject to change in the future
In the following examples, I will be using "NewStore" as the store I'm wanting to add.
Creating a store file¶
First, create a TypeScript file in src/store/model
. In this example, I'll create a file named new-store.ts
. At this point, you can copy and paste any of the other stores and change accordingly.
How to grab a container (aka selector)¶
For the containers, what you'll wanna do is use F12 on the site you want to Inspect and click this button
Hover over the item you want and it should give you the context:
You can also right-click on any website element and select 'Inspect'. That should also give you the same results.
Some people will decide to choose a parent element as it can be unique. Like this case!
I'd rather use .button.spin-button.prod-ProductCTA--primary.button--primary
instead of .spin-button-children
as there are probably other elements on the page that are also .spin-button-children
.
The reason why we use these selectors anyway is to wait for the webpage to load these specific elements, to help eliminate false positives.
For easily getting the selector, you can also copy it by right clicking on the tag, Copy > Copy selector.
Updating the models¶
You'll now want to add the new store to src/store/model/index.ts
.
This is what it will look like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
After that, you're pretty much set. If you plan on adding new models or series, you will have to add them to src/store/model/store.ts
and src/config.ts
.
Here's an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
And voila! You're done! If you'd like to contribute to the project, feel free to create a Pull Request! Don't forget to add the store (and brand, model, and series if you added) to the README.md
.
Tip
Here's an example. If you'd like to include a max price, you can add MAX_PRICE_SERIES_NEW_SERIES
to the above instead of the -1
.
Creating a Discord webhook¶
Take a look at Discord's Intro to Webhooks, that should get you going.
This is the main portion:
Use the full URL that you just copied and set that value to DISCORD_WEB_HOOK
.