diff options
-rw-r--r-- | scrape.sh | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -1,13 +1,18 @@ -rm scores.sql -rm *.pbn -for RND in {1..3} +#!/bin/bash +set -xe +PREFIX=$1 +ROUNDS=$2 +SEGMENTS=$3 +BOARDS=$4 +echo '' > ${PREFIX}_scores.sql +for RND in `seq 1 $ROUNDS` do - for SEGMENT in {1..2} + for SEGMENT in `seq 1 $SEGMENTS` do - for BOARD in {1..8} + for BOARD in `seq 1 $BOARDS` do - python scrape-scores.py ../ivld_www/ivld_rr1_${RND}b-$((($SEGMENT - 1) * 8 + $BOARD)).html $RND $SEGMENT $BOARD >> scores.sql + python scrape-scores.py ${PREFIX}${RND}b-$((($SEGMENT - 1) * $BOARDS + $BOARD)).html $RND $SEGMENT $BOARD >> ${PREFIX}_scores.sql done - python scrape-boards.py ../ivld_www/ivld_rr1_${RND}t1-${SEGMENT}.html > ${RND}-${SEGMENT}.pbn + python scrape-boards.py ${PREFIX}${RND}t1-${SEGMENT}.html > ${PREFIX}_${RND}-${SEGMENT}.pbn done done |