added logic for in stock and message
This commit is contained in:
@@ -7,5 +7,10 @@ SOURCE_FILE='/tmp/source.html'
|
||||
|
||||
wget -O ${SOURCE_FILE} ${URL}
|
||||
|
||||
GREP_RESULTS=$(grep -o '"inventory_quantity":.,' ${SOURCE_FILE} | grep -o '[0-9]\+')
|
||||
INVENTORY_QUANTITY=$(grep -o '"inventory_quantity":.,' ${SOURCE_FILE} | grep -o '[0-9]\+')
|
||||
|
||||
if [[ ${INVENTORY_QUANTITY} -gt 0 ]]; then
|
||||
MESSAGE="There are currently ${INVENTORY_QUANTITY} in stock. ${URL}"
|
||||
echo ${MESSAGE}
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user