Would this work for checking if delivery is possible? #34
-
I have a use case where I want to see if a product will become available for delivery. I'd like to check it every day. Do you think the existing functionality would cover this somehow, or should I add something? Any sense for how it would be done? Happy to add it if so. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The That’s why I’d suggest using an additional CLI tool for checking the output of the So for simply checking if a single product is availble you could use the json output and jq (one of the standard tools for json processing in the cli) to check the
I had to modify a little part in the response processing that The other part of your question is for checking in an interval. I’d suggest using common CLI tools for that too like watch, cron. In case you’re on OSX there are also ways to [trigger a Desktop Notification](https://code-maven.com/display-notification-from-the-mac-command-line. There are even tools for that on each operation system I guess. I hope this may help you. Maybe parts of this should be added to the README.md - what do you think? |
Beta Was this translation helpful? Give feedback.
The
stock
sub-command enables searching for multiple stores and products and could use the exit-code as a hint for all (or just a single) products being available or not. I’m not sure if that would be good practice for a CLI tool to misuse the exit code that way.That’s why I’d suggest using an additional CLI tool for checking the output of the
stock
command as it gives you much more flexibility on how you want to check what.So for simply checking if a single product is availble you could use the json output and jq (one of the standard tools for json processing in the cli) to check the
availability.stock
value like so: