#!/bin/bash

cp 20060101.html temp.html
while true
do
    URL=`grep nav-next temp.html | cut -d '"' -f 4`
    IMG=`grep img.src. temp.html | cut -d '"' -f 8`
    echo "Retail image: ${IMG}!"
    if [[ -z "${URL}" ]]; then
        echo no NEXT found, exiting
        break
    fi
    # echo "next:  ${URL}!"
    rm -f temp.html
    dl -f $URL temp.html
    chmod 644 temp.html
done
