Skip to content

Instantly share code, notes, and snippets.

@curreta
Created April 24, 2014 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curreta/11243075 to your computer and use it in GitHub Desktop.
Save curreta/11243075 to your computer and use it in GitHub Desktop.
Bikes Direct Downloader
#!/bin/bash
##download to disk
##wget -r -l 1 http://www.bikesdirect.com/products/road_bikes.htm
echo "<html><body>"
for sz in $(seq 49 64);
do
echo "<a href="size/${sz}/avail.txt">Size $sz:</a><br/>"
mkdir -p size/$sz;
echo "Size $sz:" > size/$sz/avail.txt;
for bike in `grep -ir "value=\"${sz}cm" products/* | grep -v SOLDOUT | cut -f 1 -d ':' | uniq`
do
echo "http://www.bikesdirect.com/"$bike >> size/$sz/avail.txt;
done
done
echo "</body></html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment