You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
289 lines
13 KiB
289 lines
13 KiB
#! /bin/sh
|
|
# Handball-Ergebnisse und Tabellen in Messagebox anzeigen
|
|
# by theobald123
|
|
# Version: 1.2 Coolstream HD1
|
|
|
|
# *************************************************************************************
|
|
# * Datenzeile in einzelne Parameter aufteilen *
|
|
# *-----------------------------------------------------------------------------------*
|
|
# * Übergabeparameter : Datenzeile *
|
|
# *************************************************************************************
|
|
Parameter ()
|
|
{ pn=$#;p1=$1;p2=$2;p3=$3;p4=$4;p5=$5;p6=$6;p7=$7;p8=$8;p9=$9;p10=$10; }
|
|
|
|
# *************************************************************************************
|
|
# * Zeichen ersetzen, HTML-Tags entfernen, Leerzeilen entfernen *
|
|
# *-----------------------------------------------------------------------------------*
|
|
# * Übergabeparameter : Eingabedatei Ausgabedatei *
|
|
# *************************************************************************************
|
|
Substitution ()
|
|
{
|
|
sed -e 's/ä/ä/g' -e 's/ä/ä/g' -e 's/ä/ä/g' -e 's/ä/ä/g' \
|
|
-e 's/ö/ö/g' -e 's/ö/ö/g' -e 's/ö/ö/g' -e 's/ö/ö/g' \
|
|
-e 's/ü/ü/g' -e 's/ü/ü/g' -e 's/ü/ü/g' -e 's/ü/ü/g' \
|
|
-e 's/Ä/Ä/g' -e 's/Ä/Ä/g' -e 's/Ä/Ä/g' -e 's/Ä/Ä/g' \
|
|
-e 's/Ö/Ö/g' -e 's/Ö/Ö/g' -e 's/Ö/Ö/g' -e 's/Ö/Ö/g' \
|
|
-e 's/Ãœ/Ü/g' -e 's/Ü/Ü/g' -e 's/Ü/Ü/g' -e 's/Ü/Ü/g' \
|
|
-e 's/à/a/g' -e 's/á/a/g' -e 's/â/a/g' -e 's/ã/a/g' -e 's/å/a/g' -e 's/æ/ae/g' \
|
|
-e 's/à/a/g' -e 's/á/a/g' -e 's/â/a/g' -e 's/ã/a/g' -e 's/å/a/g' -e 's/æ/ae/g' \
|
|
-e 's/À/A/g' -e 's/Á/A/g' -e 's/Â/A/g' -e 's/Ã/A/g' -e 's/Å/A/g' -e 's/Æ/AE/g' \
|
|
-e 's/À/A/g' -e 's/Á/A/g' -e 's/Â/A/g' -e 's/Ã/A/g' -e 's/Å/A/g' -e 's/Æ/AE/g' \
|
|
-e 's/ç/c/g' -e 's/ç/c/g' \
|
|
-e 's/Ç/C/g' -e 's/Ç/C/g' \
|
|
-e 's/è/e/g' -e 's/é/e/g' -e 's/ê/e/g' -e 's/ë/e/g' \
|
|
-e 's/è/e/g' -e 's/é/e/g' -e 's/ê/e/g' -e 's/ë/e/g' \
|
|
-e 's/È/E/g' -e 's/É/E/g' -e 's/Ê/E/g' -e 's/Ë/E/g' \
|
|
-e 's/È/E/g' -e 's/É/E/g' -e 's/Ê/E/g' -e 's/Ë/E/g' \
|
|
-e 's/ì/i/g' -e 's/í/i/g' -e 's/î/i/g' -e 's/ï/i/g' \
|
|
-e 's/ì/i/g' -e 's/í/i/g' -e 's/î/i/g' -e 's/ï/i/g' \
|
|
-e 's/Ì/I/g' -e 's/Í/I/g' -e 's/Î/I/g' -e 's/Ï/I/g' \
|
|
-e 's/Ì/I/g' -e 's/Í/I/g' -e 's/Î/I/g' -e 's/Ï/I/g' \
|
|
-e 's/ñ/n/g' -e 's/ñ/n/g' \
|
|
-e 's/Ñ/N/g' -e 's/Ñ/N/g' \
|
|
-e 's/ò/o/g' -e 's/ó/o/g' -e 's/ô/o/g' -e 's/õ/o/g' -e 's/ø/o/g' \
|
|
-e 's/ò/o/g' -e 's/ó/o/g' -e 's/ô/o/g' -e 's/õ/o/g' -e 's/ø/o/g' \
|
|
-e 's/Ò/O/g' -e 's/Ó/O/g' -e 's/Ô/O/g' -e 's/Õ/O/g' -e 's/Ø/O/g' \
|
|
-e 's/Ò/O/g' -e 's/Ó/O/g' -e 's/Ô/O/g' -e 's/Õ/O/g' -e 's/×/O/g' \
|
|
-e 's/ù/u/g' -e 's/ú/u/g' -e 's/û/u/g' \
|
|
-e 's/ù/u/g' -e 's/ú/u/g' -e 's/û/u/g' \
|
|
-e 's/ý/y/g' -e 's/ý/y/g' \
|
|
-e 's/Ù/U/g' -e 's/Ú/U/g' -e 's/Û/U/g' \
|
|
-e 's/Ø/U/g' -e 's/Ù/U/g' -e 's/Ú/U/g' \
|
|
-e 's/Ü/Y/g' -e 's/Ý/Y/g' \
|
|
-e 's/ß/ß/g' -e 's/ß/ß/g' -e 's/ß/ß/g' -e 's/ß/ß/g' \
|
|
-e 's/ss¡/+/g' -e 's/„//g' -e 's/“//g' \
|
|
-e 's/é/e/g' -e 's/é/e/g' -e 's/É/E/g' -e 's/á/a/g' -e 's/î/i/g' -e 's/ñ/n/g' \
|
|
-e 's/0/0/g' -e 's/1/1/g' -e 's/2/2/g' -e 's/3/3/g' -e 's/4/4/g' -e 's/5/5/g' -e 's/6/6/g' -e 's/7/7/g' -e 's/8/8/g' -e 's/9/9/g' \
|
|
-e 's/A/A/g' -e 's/B/B/g' -e 's/C/C/g' -e 's/D/D/g' -e 's/E/E/g' -e 's/F/F/g' -e 's/G/G/g' -e 's/H/H/g' -e 's/I/I/g' -e 's/J/J/g' -e 's/K/K/g' -e 's/L/L/g' -e 's/M/M/g' -e 's/N/N/g' -e 's/O/O/g' -e 's/P/P/g' -e 's/Q/Q/g' -e 's/R/R/g' -e 's/S/S/g' -e 's/T/T/g' -e 's/U/U/g' -e 's/V/V/g' -e 's/W/W/g' -e 's/X/X/g' -e 's/Y/Y/g' -e 's/Z/Z/g' \
|
|
-e 's/a/a/g' -e 's/b/b/g' -e 's/c/c/g' -e 's/d/d/g' -e 's/e/e/g' -e 's/f/f/g' -e 's/g/g/g' -e 's/h/h/g' -e 's/i/i/g' -e 's/j/j/g' -e 's/k/k/g' -e 's/l/l/g' -e 's/m/m/g' -e 's/n/n/g' -e 's/o/o/g' -e 's/p/p/g' -e 's/q/q/g' -e 's/r/r/g' -e 's/s/s/g' -e 's/t/t/g' -e 's/u/u/g' -e 's/v/v/g' -e 's/w/w/g' -e 's/x/x/g' -e 's/y/y/g' -e 's/z/z/g' \
|
|
-e 's/°/°/g' -e 's/°/°/g' -e 's/°/°/g' \
|
|
-e 's/&/\&/g' \
|
|
-e 's/"/\"/g' -e 's/„/\"/g' -e 's/“/\"/g' -e "s/'/\"/g" -e 's/'/\"/g' \
|
|
-e 's/>/>/g' \
|
|
-e 's/</</g' \
|
|
-e 's/ / /g' \
|
|
-e 's/±/+\/-/g' \
|
|
-e 's/€/EUR/g' \
|
|
-e 's/<br>/ /g' \
|
|
-e 's/<[^>]*>//g' \
|
|
-e '/^[^0-9a-zA-Z!-\/]*$/d' \
|
|
$1 > $2
|
|
}
|
|
|
|
# *************************************************************************************
|
|
# * Funktion zur Anzeige der Ergebnisse (copyright PauleFoul) *
|
|
# *-----------------------------------------------------------------------------------*
|
|
# * Übergabeparameter 1: Anzeigedateiname *
|
|
# * Übergabeparameter 2: Fontgröße für Anzeige *
|
|
# *************************************************************************************
|
|
|
|
Ergebnisse ()
|
|
{
|
|
cp $1 /tmp/anzeige_neu.txt
|
|
if [ $msg_on -eq 0 ]; then
|
|
if [ $aktu -eq 1 ]; then
|
|
msgbox title="$Head" size=$2 timeout=-1 popup=/tmp/anzeige_neu.txt &
|
|
else
|
|
msgbox title="$Head" size=$2 msg=/tmp/anzeige_neu.txt
|
|
rm /tmp/anzeige_*.txt; rm /tmp/test*.txt
|
|
ende=1
|
|
wait=0
|
|
fi
|
|
fi
|
|
|
|
#Wartezeit bis zum Refresh
|
|
if [ $ende -eq 0 ]; then
|
|
while [ $timer -le $wait ]; do
|
|
if pidof msgbox > /dev/null; then #Messagebox aktiv?
|
|
msg_on=1
|
|
else
|
|
rm /tmp/anzeige_*.txt; rm /tmp/test*.txt
|
|
ende=1
|
|
wait=0
|
|
fi
|
|
sleep 1
|
|
timer=`expr "$timer" + 1`
|
|
done
|
|
fi
|
|
timer=0
|
|
}
|
|
|
|
# *************************************************************************************
|
|
# * Funktion zum Erstellen der Tabelle für die Ligen *
|
|
# *-----------------------------------------------------------------------------------*
|
|
# * Übergabeparameter 1: Internet-Adresse *
|
|
# *************************************************************************************
|
|
|
|
Tabelle ()
|
|
{
|
|
rm /tmp/test*.txt
|
|
wget -q -O /tmp/test1.txt $1
|
|
sed -n '/Gesamt-Tabelle/,/Letzte Aktualisierung/ p' /tmp/test1.txt > /tmp/test2.txt
|
|
Substitution /tmp/test2.txt /tmp/test3.txt
|
|
sed -e '/-->/d' /tmp/test3.txt > /tmp/test4.txt
|
|
schluss=`sed -ne "$ =" /tmp/test4.txt`
|
|
echo "~T0200Pl.~T0250Team~T0550Sp.~T0600Punkte~T0700Tore~T0820Diff." >> /tmp/test5.txt
|
|
tab1=13; tab2=14; tab3=15; tab4=19; tab5=20; tab6=21; tab7=22; step=11
|
|
while [ $tab7 -le $schluss ]; do
|
|
a1=`sed -n "$tab1"p /tmp/test4.txt`;a1=`echo $a1` # Platz
|
|
a2=`sed -n "$tab2"p /tmp/test4.txt`;a2=`echo $a2` # Team
|
|
a3=`sed -n "$tab3"p /tmp/test4.txt`;a3=`echo $a3` # Spiele
|
|
a4=`sed -n "$tab4"p /tmp/test4.txt|sed -e 's/ //g' -e 's/:/~T0630:~T0650/g'`;a4=`echo $a4` # Punkte
|
|
a5=`sed -n "$tab5"p /tmp/test4.txt`;a5=`echo $a5` # +
|
|
a6=`sed -n "$tab6"p /tmp/test4.txt`;a6=`echo $a6` # -
|
|
a7=`sed -n "$tab7"p /tmp/test4.txt`;a7=`echo $a7` # Tordifferenz
|
|
echo "~T0200$a1~T0250$a2~T0550$a3~T0600$a4~T0700$a5~T0740:~T0760$a6~T0820$a7" >> /tmp/test5.txt
|
|
tab1=`expr "$tab1" + $step`; tab2=`expr "$tab2" + $step`; tab3=`expr "$tab3" + $step`; tab4=`expr "$tab4" + $step`; tab5=`expr "$tab5" + $step`; tab6=`expr "$tab6" + $step`; tab7=`expr "$tab7" + $step`
|
|
done
|
|
msgbox title="Tabelle der $2" size=22 timeout=600 popup=/tmp/test5.txt #Tabelle anzeigen
|
|
|
|
#TMP-Dateien loeschen
|
|
rm /tmp/test*.txt
|
|
}
|
|
|
|
# *************************************************************************************
|
|
# * 1. Position der Spieldaten pro Abschnitt ermitteln *
|
|
# *-----------------------------------------------------------------------------------*
|
|
# * Übergabeparameter : Suchstring *
|
|
# *************************************************************************************
|
|
Anfang ()
|
|
{
|
|
a1=""
|
|
while [ "$1" != "" ]; do
|
|
a1=$1
|
|
shift
|
|
done
|
|
}
|
|
|
|
# *************************************************************************************
|
|
# * Spielpaarungen auslesen *
|
|
# *************************************************************************************
|
|
Paarungen ()
|
|
{
|
|
rm /tmp/test5*.txt
|
|
tab1=`expr "$1" + 1`; tab2=`expr "$1" + 2`; tab3=`expr "$1" + 3`; tab4=`expr "$1" + 4`; step=4; count=1
|
|
stop=$2
|
|
while [ $tab4 -le $stop ]; do
|
|
a1=`sed -n "$tab1"p /tmp/test4.txt` # Heimmannschaft
|
|
a2=`sed -n "$tab2"p /tmp/test4.txt|sed -e 's/:/~T0930:~T0950/g'` # Spielstand
|
|
a3=`sed -n "$tab3"p /tmp/test4.txt` # Gastmannschaft
|
|
a4=`sed -n "$tab4"p /tmp/test4.txt` # Termin
|
|
Rest=`expr "$count" % 2`
|
|
if [ $Rest -eq 0 ]; then
|
|
echo "~T0190$a4~T0350$a1~T0620-~T0630$a3~T0900$a2" >> /tmp/test5R.txt
|
|
else
|
|
echo "~T0190$a4~T0350$a1~T0620-~T0630$a3~T0900$a2" >> /tmp/test5L.txt
|
|
fi
|
|
tab1=`expr "$tab1" + $step`; tab2=`expr "$tab2" + $step`; tab3=`expr "$tab3" + $step`; tab4=`expr "$tab4" + $step`; count=`expr "$count" + 1`
|
|
done
|
|
cat /tmp/test5L.txt /tmp/test5R.txt >> /tmp/test6.txt
|
|
}
|
|
|
|
# *************************************************************************************
|
|
# * Funktion zum Erstellen der Ergebnisse für die Ligen *
|
|
# *-----------------------------------------------------------------------------------*
|
|
# * Übergabeparameter 1: Internet-Adresse *
|
|
# *************************************************************************************
|
|
|
|
Spiele ()
|
|
{
|
|
rm /tmp/test*.txt
|
|
ende=0
|
|
while [ $ende -eq 0 ]; do
|
|
wget -q -O /tmp/test1.txt $1
|
|
sed -n '/LIVETICKER/,$ p' /tmp/test1.txt > /tmp/test2.txt
|
|
sed -ne '3p' \
|
|
-ne '/LIVE/ p' \
|
|
-ne '/COMING/ p' \
|
|
-ne '/OVER/ p' \
|
|
-ne '/class=\"inhalt bold/ p' /tmp/test2.txt > /tmp/test3.txt
|
|
Substitution /tmp/test3.txt /tmp/test4.txt
|
|
Head=`sed -n '2p' /tmp/test4.txt`
|
|
LIVE=`sed -ne "/^LIVE$/ =" /tmp/test4.txt`
|
|
Anfang $LIVE
|
|
LIVE=$a1
|
|
COMING=`sed -ne "/^COMING$/ =" /tmp/test4.txt`
|
|
Anfang $COMING
|
|
COMING=$a1
|
|
OVER=`sed -ne "/^OVER$/ =" /tmp/test4.txt`
|
|
Anfang $OVER
|
|
OVER=$a1
|
|
schluss=`sed -ne "$ =" /tmp/test4.txt`
|
|
rm /tmp/test6.txt
|
|
# LIVE-Spiele
|
|
p1=$LIVE
|
|
if [ "$COMING" != "" ]; then
|
|
p2=$COMING
|
|
elif [ "$OVER" != "" ]; then
|
|
p2=$OVER
|
|
else
|
|
p2=$schluss
|
|
fi
|
|
if [ "$p1" != "" ]; then
|
|
echo ~cLIVE >> /tmp/test6.txt
|
|
Paarungen $p1 $p2
|
|
fi
|
|
# nächste Spiele
|
|
p1=$COMING
|
|
if [ "$OVER" != "" ]; then
|
|
p2=$OVER
|
|
else
|
|
p2=$schluss
|
|
fi
|
|
echo "COMING:" $p1 $p2
|
|
if [ "$p1" != "" ]; then
|
|
echo ~cn~achste Spiele >> /tmp/test6.txt
|
|
Paarungen $p1 $p2
|
|
fi
|
|
# letzte Spiele
|
|
p1=$OVER
|
|
p2=$schluss
|
|
echo "OVER:" $p1 $p2
|
|
if [ "$p1" != "" ]; then
|
|
echo ~cletzte Spiele >> /tmp/test6.txt
|
|
Paarungen $p1 $p2
|
|
fi
|
|
Ergebnisse /tmp/test6.txt 22
|
|
done
|
|
rm /tmp/test*.txt
|
|
}
|
|
|
|
# *************************************************************************************
|
|
# * Liga ausw~ahlen und Daten aus Internet in eine lokale Datei einlesen *
|
|
# *************************************************************************************
|
|
|
|
auswahl=1
|
|
while true; do
|
|
msg_on=0
|
|
timer=0
|
|
wait=20
|
|
aktu=1 #Bei 1 ist automatische Aktualisierung ein
|
|
msgbox title="Handball Live-Ergebnisse" size=28 order=2 msg="~cBitte eine Liga ausw~ahlen!" select="1.Liga,Tabelle,2.Liga,Tabelle" default=$auswahl
|
|
auswahl=$?
|
|
|
|
case $auswahl in
|
|
1)
|
|
Spiele "http://liveticker.dkb-handball-bundesliga.de/uebersicht_erste.html"
|
|
;;
|
|
|
|
2)
|
|
Tabelle "http://www.dkb-handball-bundesliga.de/handball/tabelle.php?liga=1" "DKB Handball-Bundesliga"
|
|
;;
|
|
|
|
3)
|
|
Spiele "http://liveticker.dkb-handball-bundesliga.de/uebersicht_zweite.html"
|
|
;;
|
|
|
|
4)
|
|
Tabelle "http://www.dkb-handball-bundesliga.de/handball/tabelle.php?liga=2" "2. Handball-Bundesliga"
|
|
;;
|
|
|
|
*)
|
|
rm /tmp/test*.txt;
|
|
exit
|
|
;;
|
|
|
|
esac
|
|
done
|
|
|
|
exit
|
|
|