Skip to content

Instantly share code, notes, and snippets.

@ZE3kr
Last active November 13, 2021 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZE3kr/1fe4a3b23e12021dcfa2b5bf5435c938 to your computer and use it in GitHub Desktop.
Save ZE3kr/1fe4a3b23e12021dcfa2b5bf5435c938 to your computer and use it in GitHub Desktop.
苹果官网发货状态检测
#!/bin/bash
for (( ; ; )); do
mv new.txt old.txt 2> /dev/null
curl "https://www.apple.com.cn/xc/cn/vieworder/W123456789/name@example.com" -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