Last active
November 13, 2021 09:18
-
-
Save ZE3kr/1fe4a3b23e12021dcfa2b5bf5435c938 to your computer and use it in GitHub Desktop.
苹果官网发货状态检测
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for (( ; ; )); do | |
mv new.txt old.txt 2> /dev/null | |
curl "https://www.apple.com.cn/xc/cn/vieworder/W123456789/[email protected]" -s -L | grep "currentStatus" | jq '.orderDetail.orderItems."orderItem-0000101".orderItemStatusTracker.d.currentStatus' > new.txt | |
DIFF_OUTPUT="$(diff new.txt old.txt)" | |
if [ "0" != "${#DIFF_OUTPUT}" ]; then | |
// DO SOMETHING HERE | |
fi | |
sleep 300 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment