From 1216f583b1e62f6ca4b00246417880d5e04905ad Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 15 Mar 2020 18:49:08 +0100 Subject: Non-harcoded tournament params --- scrape.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scrape.sh b/scrape.sh index 489ecf4..8d7639a 100644 --- a/scrape.sh +++ b/scrape.sh @@ -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 -- cgit v1.2.3