diff options
| author | tslil <tslil@posteo.de> | 2021-01-04 00:12:33 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2021-01-04 00:48:56 -0500 |
| commit | 1d4ff80f3fe04c0fc730e211d0385e9fcf9e7517 (patch) | |
| tree | 0f38672190a993e82b924bd86a78621be2cb80eb /data/extract.sh | |
| parent | 3cf5c5ba291e86bfebb6178612e72e8d5b2d7bbb (diff) | |
Fixed indentation and some bugs, stats programme
Diffstat (limited to 'data/extract.sh')
| -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 |
