diff options
Diffstat (limited to 'data')
| -rwxr-xr-x | data/extract.sh | 9 |
1 files changed, 7 insertions, 2 deletions
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 |
