aboutsummaryrefslogtreecommitdiff
path: root/data/extract.sh
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-01-04 00:12:33 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commitc601baf9004b7defb03caf3d5794c28fc2311f30 (patch)
tree0f38672190a993e82b924bd86a78621be2cb80eb /data/extract.sh
parent9e1bec11e01d56578a9d174e1ff5d689c8437a8a (diff)
Fixed indentation and some bugs, stats programme
Diffstat (limited to 'data/extract.sh')
-rwxr-xr-xdata/extract.sh9
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