summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fetch-cezar-db.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/fetch-cezar-db.sh b/bin/fetch-cezar-db.sh
new file mode 100755
index 0000000..839e07c
--- /dev/null
+++ b/bin/fetch-cezar-db.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+PAGEDIR=`dirname $0`
+DATE=`date --date='yesterday' +%Y%m%d`
+OUTPUTFILE=`realpath $PAGEDIR/../data/cezar/$DATE.csv`
+wget http://msc.com.pl/cezar/download/baza.csv -q -O - | iconv -f windows-1250 -t utf-8 > temp
+if [ -s temp ]; then
+ tail -n +2 temp | sort > $OUTPUTFILE
+ echo "Downloaded Cezar CSV into $OUTPUTFILE"
+else
+ echo 'Cezar CSV fetch failed'
+fi
+rm temp