#!/bin/sh
echo "Achtung: '-' aus Datumsangaben raus!!"
DATUM=`date +%Y%W`
rm -f index.html*
wget http://www.br-online.de/bayern3/comedy/erwin-pelzig/artikel/index/
grep av-files index.html | \
    sed -e 's?^.*xmlFile=\(/repositories/av-files/metadaten\)?http://www.br-online.de/cgi-bin/ravi\?verzeichnis=audio/\&g2=1\&file=\1?' \
	-e 's/\.xml.*/.rm/' | \
    uniq | \
    sed -e 's/^/v_recordplay /' \
        -e 's/metadaten/mediafiles/' \
	-e 's/&/\\&/g' \
        -e 's?/audio/\(.*\)_a\.rm?& ; mv /tmp/v_recordplay.wav \1.wav?' \
        -e 's/\(\.wav 20[0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\)_/\1\2\3_/' \
	-e 's/\(v_recordplay.wav 20[-0-9]*\)_[-0-9]*_.*Erw*inPelzig/\1_/' | \
cat > script

chmod 755 script
rm index.html

exit
   sed "s/ /_/g" | \
   grep -v "<font_size.*face=.VERDANA," | \
   grep -v "<td_width=\"390\"" | \
   sed "s?^<tr><td_width=.60..bgcolor=.*><a_href=\"?v_recordplay http://www.br-online.de/?" | \
   sed "s?\"><img.src=\".*??" | \
   sed "s/.\(.\)uml;/\1e/g" | \
   sed "s?.*<b>\(.*\)</b>.*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*?mv /tmp/v_recordplay.wav \4\3\2_\1.wav?" | \
   sed "s?.*<b>\(.*\)</b>.*?mv /tmp/v_recordplay.wav ${DATUM}_\1.wav?" | \
   sed "s?\(/a/\)\(.file=\)?\1\\\\\2?" | \
   sed "s?/\(/cgi-bin\)?\1?" | \
   sed "s/&/\\\\&/g" | \
   grep -v -- "^--" | \
cat > script

chmod 755 script
# rm index.html

exit


   sed "s?ra:\([^<]*\).*--\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)-->?ra; mv /tmp/v_recordplay.wav 20\4\3\2-\1.wav?" | \
   sed "s?^.*\(verzeichnis=.*n3/a/.file=[0-9]*.ra\)\"><img s.*</a>?v_recordplay http://www.br-online.de/cgi-bin/ravi\1:?" | \
