From c601baf9004b7defb03caf3d5794c28fc2311f30 Mon Sep 17 00:00:00 2001 From: tslil Date: Mon, 4 Jan 2021 00:12:33 -0500 Subject: Fixed indentation and some bugs, stats programme --- data/extract.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/extract.sh b/data/extract.sh index 7acb1e2..37ce12c 100755 --- a/data/extract.sh +++ b/data/extract.sh @@ -1,14 +1,15 @@ #!/bin/bash +db_file=games_anon.db + query() { echo "SELECT $1 FROM games WHERE (size == $2) \ and (result != '1-0') and (result != '0-1') and (result != '0-0');" } extract() { - in_file=games_anon.db for size in 5 6; do - sqlite3 "$in_file" "$(query $1 $size)" > "playtak-$size" + sqlite3 "$db_file" "$(query $1 $size)" > "playtak-$size" done } @@ -88,4 +89,8 @@ extract_ptn() { done < "playtak-$size" } +if [ ! -f "$db_file" ]; then + wget "https://www.playtak.com/games_anon.db" +fi + extract notation -- cgit v1.3.1