From 742f0e753e3968d00ca795706dc622c41ab576a9 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 7 Jun 2017 02:25:52 +0200 Subject: Helper script for fetching Cezar players DB --- bin/fetch-cezar-db.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bin/fetch-cezar-db.sh (limited to 'bin') 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 -- cgit v1.2.3