From 6527805fb2d64372fb98de5e05230301b222f841 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 19 Oct 2017 22:20:23 +0200 Subject: [PATCH] scripts/fahrplan-import.sh: reimplement --- scripts/fahrplan-import.sh | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/scripts/fahrplan-import.sh b/scripts/fahrplan-import.sh index 0c58cb974..c30912a42 100755 --- a/scripts/fahrplan-import.sh +++ b/scripts/fahrplan-import.sh @@ -1,23 +1,19 @@ -#!/bin/sh +#!/usr/bin/env bash -# c3d2-web $ ./scripts/fahrplan-import.sh +set -e +set -x -cd ./content/static/datenspuren/2011/ || exit 1 +CONF=DS2017 +ROOT=$(dirname $0)/.. -mkdir .tmp -cd .tmp -curl https://cccv.pentabarf.org/DS2011.tar.gz | tar xz -rm DS2011/style.css -IFS=" -" -for f in $(find . -name \*.html) -do - sed -e 's/Computersicherheitsworkshop/Computer\­sicher\­heits\­work\­shop/g' \ - -i "$f" -done -cp -r DS2011/* ../fahrplan/ -cd .. -rm -r .tmp -git add ./fahrplan -git commit -m 'fahrplan import [auto]' +cd $ROOT/content/static/datenspuren/2017 +curl -b "_another_frab_session=$FRAB_SESSION" \ + https://frab.cccv.de/en/$CONF/schedule/download_static_export?export_locale=de \ + > $CONF.tar.gz +tar xzf $CONF.tar.gz +rm $CONF.tar.gz +[ -d fahrplan/ ] && git rm -r fahrplan/ +mv $CONF/ fahrplan/ +git add fahrplan +git commit -m "ds17: fahrplan update"