summaryrefslogtreecommitdiff
path: root/backup-tc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'backup-tc.sh')
-rwxr-xr-xbackup-tc.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/backup-tc.sh b/backup-tc.sh
new file mode 100755
index 0000000..79f235c
--- /dev/null
+++ b/backup-tc.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+URL=$1
+[[ $URL =~ (/?(index\.html)?(\#.*)?$) ]] && \
+ URL=${URL//$BASH_REMATCH/}
+
+OUTPUT_DIR="$2"
+if [ -z "$OUTPUT_DIR" ]
+then
+ OUTPUT_DIR="."
+fi
+
+mkdir -p "$OUTPUT_DIR"
+
+wget --mirror --page-requisites --no-parent --no-directories --directory-prefix="$OUTPUT_DIR" "$URL/"
+
+for FILE in settings.json results.json vp.json butler.json cs.json
+do
+ wget -N --directory-prefix="$OUTPUT_DIR" "$URL/$FILE"
+done
+
+for LANG in pl en
+do
+ wget -N --directory-prefix="$OUTPUT_DIR/language" "$URL/language/$LANG.json"
+done
+
+python backup-tc.py "$URL" "$OUTPUT_DIR"