Created
February 17, 2012 05:44
-
-
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
This file contains hidden or 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
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' '[email protected]' ); else echo 'not changed'; fi; rm -f /tmp/lastsizes; cp /tmp/lastsizesLATEST /tmp/lastsizes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note that for linux systems you need to use "xpath -e" instead of just "xpath"