# AppStorePriceWatch # by Davis Remmel - August 2012 # # Description: scrapes Apple's App Store product pages and alerts to changes in prices. Useful for alerting a # potential customer about sales for watched items. # # Possible future additions: # + Scrape a user's iTunes wishlist # ################################################################# #!/bin/sh # Put the URL of every app you want to monitor here as part of the "APPURL[]" array APPURL=( http://itunes.apple.com/us/app/frogatto/id382015046?mt=8 # Frogatto http://itunes.apple.com/us/app/freddi-fish-stolen-shell/id511501137?mt=8 # Freddi Fish ) # Put the 'standard' price here so the script can detect changes APPSTDPRICE=( 4.99 # Frogatto 2.99 # Freddi Fish ) COUNT=0 for i in ${APPURL[@]} do : APPTITLE=$(curl -s $i | perl -nle 'print for m:App Store - (.*):') CURRENTPRICE=$(curl -s $i | perl -nle 'print for m:
  • \$?(.*)
  • :') if [ "$CURRENTPRICE" != "${APPSTDPRICE[$COUNT]}" ]; then open $i DIALOG="$APPTITLE changed from \$$APPSTDPRICE to \$$CURRENTPRICE." osascript -e "tell application \"Finder\" to display dialog \"$DIALOG\"" fi COUNT=$[COUNT+1] done