Skip to content

Instantly share code, notes, and snippets.

@lg
Created February 17, 2012 05:44
Show Gist options
  • Save lg/1851003 to your computer and use it in GitHub Desktop.
Save lg/1851003 to your computer and use it in GitHub Desktop.
Monitor Converse's website for available shoe sizes on a given sku and send an email when changed
curl --silent 'http://www.converse.com/handler/Products/ProductDetailHandler.ashx?sku=129331C' | xpath '/ProductDetailHandler/Product/ShoeSizes/ShoeSize/Size[@type="US Mens"]/text()' 2>&1 | sed 's/-- NODE --//'| sed 's/Found.*//' | egrep '.' > /tmp/lastsizesLATEST ; if ! diff /tmp/lastsizesLATEST /tmp/lastsizes > /dev/null; then $( cat /tmp/lastsizesLATEST | mail -s 'shoe sizes changed' 'youremail@gmail.com' ); else echo 'not changed'; fi; rm -f /tmp/lastsizes; cp /tmp/lastsizesLATEST /tmp/lastsizes
@lg
Copy link
Author

lg commented Feb 17, 2012

note that for linux systems you need to use "xpath -e" instead of just "xpath"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment