#! /bin/bash
# Last edited on 2014-12-02 18:25:30 by stolfilocal

fetchdate="$1"; shift  # Approx current date, since the pages change with time.
wallet="$1"; shift     # Wallet name, as assigned by "www.walletexplorer.com".
lopage="$1"; shift     # Number of first page to fetch.
hipage="$1"; shift     # Number of last page to fetch.

urldir="http://www.walletexplorer.com/wallet/${wallet}"
outdir="raw/${wallet}/${fetchdate}"
mkdir -p ${outdir}

for n in `seq -f '%04.0f' ${lopage} ${hipage}` ; do 
  wget -nv "${urldir}?page=${n}" -O "${outdir}/${n}.html" 
  sleep 5
done

