- Have
opam
installed and setup for easiest building - Have a working
sendmail
conf for mail notifications
Run these commands in the project root directory:
$ opam switch create . --locked # This is expected to take quite some time
$ decathlon-stock --help
Install within an already existing opam
switch:
$ opam pin add .
$ decathlon-stock --help
Build and run without installing, if dependencies are met:
$ dune exec decathlon-stock -- --help
Get the URL of a decathlon product that you want to watch the stock
for (for instance,
https://www.decathlon.fr/p/some-product-name/_/R-p-12345
).
Then, to check every fifteen minutes the stock of this item for the sizes S and XL, run:
$ decathlon-stock \
--mail [email protected] \
--period 15 \
--sizes S,XL
"https://www.decathlon.fr/p/some-product-name/_/R-p-12345"
The program will then run without stopping, printing the stock every 15 minutes. Upon finding some new stock for at least one of the specified sizes, it will send a mail to the provided address. Only one mail will be send for each size when stock becomes available. If it then becomes out of stock, then available again, another mail will be sent.
More doc is available under the --help
option.