[Openstandaarden] Toegankelijkheid sites VRT
Sander Devrieze
s.devrieze at pandora.be
Tue Nov 22 23:16:38 CET 2005
Op maandag 21 november 2005 16:50, schreef Johan Vervloet:
> On Mon, Nov 21, 2005 at 04:36:10PM +0100, Dieter Van Uytvanck wrote:
> > On Mon, Nov 21, 2005 at 04:22:24PM +0100, johan at linux.be wrote:
> > > en iets windows-media achtig nodig hebt.
> >
> > Alle on-demand uitzendingen kan je toch ook via een gewone link naar
> > een MP3 beluisteren? Dat vind ik al een enorme vooruitgang tov. vroeger.
>
> Interessant... Maar waar vind ik die dan voor bijv. radio 1? Ik klik op
> `programma's', dan op eender welke programmatitel. De link ` besluister
> de jongste uitzending' probeert vanalle javadingen te starten, maar dat
> wil hier maar niet lukken.
>
> Ik vind geen links naar mp-3-bestanden :(
Volgende scriptjes kunnen helpen:
1) Het hoofdscript dat ge bedient via lirc of klineakd (of hoe dat juist
noemt):
#!/bin/sh
# By Sander Devrieze.
version="0.5"
# Check for first user supplied option or default=--help.
if [ $1 ] ; then
option=$1
else
option="--help"
fi
# Create cache directory and config file if they do not yet exist
if [ ! -f $HOME/.playnews/cache/ ] ; then
mkdir -p $HOME/.playnews/cache/
fi
if [ ! -f $HOME/.playnews/config ] ; then
echo "PLAYER=mplayer
# Choose hi, med of lo
QUALITY=hi
SDIR=/usr/local/share/playnews" > $HOME/.playnews/config
fi
# Read config file
source $HOME/.playnews/config
autoclean () {
echo "Cleaning files older than 2 days."
find $HOME/.playnews/cache/* -mtime +2 -exec rm {} \;
}
case $option in
-c|--clean) # Clean cache.
echo "Cleaning cache."
rm $HOME/.playnews/cache/*
;;
-l|--list) # List available plugins.
echo "The following plugins are available:"
ls -1 $SDIR/plugins
;;
-v|--version) # Print version number.
;;
*) # Execute plugins or display help.
for plugin in `ls $SDIR/plugins`
do
if [ "$1" == "$plugin" ] ; then
source $SDIR/plugins/$1
help=no
fi
done
if [ "$help" != "no" ] ; then
echo "playnews [plugin] [options]"
echo " -c --clean clean cache"
echo " -l --list list available
plugins"
echo " -v --version print version number"
fi
;;
esac
De radio1 plugin:
#
# radio1 plugin for playnews - by Sander Devrieze.
#
version="0.5"
# Only uncomment if you want to use another player for this plugin than the
player specified in playnews.
#PLAYER=mplayer
QUALITY=hi
# Check for user supplied options or default=--help.
if [ $2 ] ; then
shift # $@-$1
options=$@
else
options="--help"
fi
# tekst updaten
# Variable for hour in 24 hour format.
set -$- `/bin/date '+%k %k%M'`
hour=$1 time=$2
# Functions.
# deze zeker aanpassen voor betere cache-idee: de datestring moet die van de
laatste uizending zijn
datestring () {
if [ $time -lt $online_time ] ; then
date +%F --date yesterday
else
date +%F
fi
}
download () {
FILE=`echo $file`-`datestring`
cachefile=$HOME/.playnews/cache/$FILE-$QUALITY.mp3
url="http://mp3.streampower.be/vrt/radio1/11_11$file-$QUALITY.mp3"
if [ ! -f $cachefile ] ; then
echo "$HOME/.playnews/cache/$FILE.mp3 not found, downloading
it from $url"
wget -p $url -O $HOME/.playnews/cache/$FILE-$QUALITY.mp3
fi
echo "File $FILE.mp3 cached."
}
news () {
# Determine the hour of the most recent news broadcast.
case $hour in
[0-6]) echo 24 ;;
[7-9]) echo 07 ;;
1[0-2]) echo 07 ;;
1[3-7]) echo 13 ;;
18) echo 18 ;;
19) echo 19 ;;
2[0-4]) echo 19 ;;
esac
}
play () {
$PLAYER $HOME/.playnews/cache/$FILE-$QUALITY.mp3
}
for option in $options
do
case $option in
-ac|--actueel) # play Actueel.
echo "Playing Actueel."
online_time=1320
file=actu
autoclean
download
play
;;
-bo|--boodschap) # play De groote boodschap.
echo "Playing De groote boodschap."
online_time=2320
file=bood
autoclean
download
play
;;
-ca|--carte) # play Carte blanche.
echo "Playing Carte blanche."
online_time=1215
file=cart
autoclean
download
play
;;
-cl|--club) # play In de club.
echo "Playing In de club."
online_time=2320
file=idcl
autoclean
download
play
;;
-co|--concert) # play Het concertgebouw.
echo "Playing Het concertgebouw."
online_time=2320
file=hcgb
autoclean
download
play
;;
-cu|--cucamonga) # play Cucamonga.
echo "Playing Cucamonga."
online_time=2320
file=cuca
autoclean
download
play
;;
-el|--eldorado) # play Eldorado.
echo "Playing Eldorado."
online_time=1520
file=eldo
autoclean
download
play
;;
-gu|--gulliver) # play Gulliver.
echo "Playing Gulliver."
online_time=2320
file=gull
autoclean
download
play
;;
-kr|--krant) # play Krantenkoppen.
echo "Playing Krantenkoppen."
# Opzoeken wanneer dat juist online komt! (ook voor andere bestanden
nazien!!!)
online_time=2420
file=bipo
autoclean
download
play
;;
-ma|--maandag) # play Maandag wasdag.
echo "Playing Maandag wasdag."
online_time=1120
file=mawd
autoclean
download
play
;;
-ne|--neon) # play Neon.
echo "Playing Neon."
online_time=1720
file=neon
autoclean
download
play
;;
-pi|--pili) # play Pili-pili.
echo "Playing Pili-pili."
online_time=2120
file=pili
autoclean
download
play
;;
-pl|--play) # play most recent news broadcast.
echo "Playing news of `news` o' clock."
online_time=`news`15
file=ni`news`
autoclean
download
play
;;
-7|--play7) # play news of 7 o' clock.
echo "Playing news of 7 o' clock."
online_time=715
file=ni07
autoclean
download
play
;;
-13|--play13) # play news of 13 o' clock.
echo "Playing news of 13 o' clock."
online_time=1315
file=ni13
autoclean
download
play
;;
-18|--play18) # play news of 18 o' clock.
echo "Playing news of 18 o' clock."
online_time=1815
file=ni18
autoclean
download
play
;;
-19|--play19) # play news of 19 o' clock.
echo "Playing news of 19 o' clock."
online_time=1915
file=ni19
autoclean
download
play
;;
-24|--play24) # play news of 24 o' clock.
echo "Playing news of 24 o' clock."
online_time=2415
file=ni24
autoclean
download
play
;;
-re|--reyerscomplex) # play Het reyerscomplex.
echo "Playing Het reyerscomplex."
online_time=1315
file=reco
autoclean
download
play
;;
-ro|--rockfort) # play Rockfort.
echo "Playing Rockfort."
online_time=1720
file=roc4
autoclean
download
play
;;
-sa|--salon) # play Het salon.
echo "Playing Het salon."
online_time=1320
file=salo
autoclean
download
play
;;
-sh|--shuffle) # play Shuffle.
echo "Playing Shuffle."
online_time=1920
file=shuf
autoclean
download
play
;;
-si|--sirocco) # play Sirocco.
echo "Playing Sirocco."
online_time=1520
file=siro
autoclean
download
play
;;
-sp|--spel) # play Brood en spelen.
echo "Playing Brood en spelen."
online_time=2320
file=brsp
autoclean
download
play
;;
-ta|--tante) # play Mijn tante in Alaska.
echo "Playing Mijn tante in Alaska."
online_time=2015 # onbekend?!!
file=tant
autoclean
download
play
;;
-te|--tekstbaron) # play De tekstbaronnen.
echo "Playing De tekstbaronnen."
online_time=1415
file=teta
autoclean
download
play
;;
-ti|--titaan) # play Titaantjes.
echo "Playing Titaantjes."
online_time=1015
file=tita
autoclean
download
play
;;
-tr|--tropical) # play Club tropical.
echo "Playing Club tropical."
online_time=2320
file=trop
autoclean
download
play
;;
-vo|--voor) # play Voor de dag.
echo "Playing Voor de dag."
online_time=1300
file=vdda
autoclean
download
play
;;
-we|--wereld) # play De nieuwe wereld.
echo "Playing De nieuwe wereld."
online_time=1320
file=dnwe
autoclean
download
play
;;
-ws|--wandelsport) # play De wandelgangen Sport.
echo "Playing De wandelgangen Sport."
online_time=1720 # onbekend?!!
file=wgsp
autoclean
download
play
;;
-v|--version) # Print version number.
echo "radio1 module version "$version
;;
*) # Display help.
echo "playnews radio1 [options]"
echo
echo "BROADCASTS"
echo " -ac --actueel play Actueel"
echo " -bo --boodschap play De groote
boodschap."
echo " -ca --carte play Carte
blanche."
echo " -cl --club play In de
club."
echo " -co --concert play Het
concertgebouw."
echo " -cu --cucamonga play
Cucamonga."
echo " -el --eldorado play
Eldorado."
echo " -gu --gulliver play
Gulliver."
echo " -kr --krant play
Krantenkoppen."
echo " -ma --maandag play Maandag
wasdag."
echo " -ne --neon play Neon."
echo " -pi --pili play
Pili-pili."
echo " -pl --play play most
recent news broadcast"
echo " -{7,13,18,19,24} --play{7,13,18,19,24} play news of
7,13,18,19 or 24 o'clock"
echo " -re --reyerscomplex play Het
reyerscomplex."
echo " -ro --rockfort play
Rockfort."
echo " -sa --salon play Het
salon."
echo " -sh --shuffle play Shuffle."
echo " -si --sirocco play Sirocco."
echo " -sp --spel play Brood en
spelen."
echo " -ta --tante play Mijn
tante in Alaska."
echo " -te --tekstbaron play De
tekstbaronnen."
echo " -ti --titaan play
Titaantjes."
echo " -tr --tropical play Club
tropical."
echo " -vo --voor play Voor de
dag."
echo " -wa --wandelgang play De
wandelgangen."
echo " -we --wereld play De nieuwe
wereld."
echo " -ws --wandelsport play De
wandelgangen Sport."
echo
echo "OTHER OPTIONS"
echo " -h --help display help"
echo " -v --version print version
number"
;;
esac
done
--
Mvg, Sander Devrieze.
xmpp:sander at devrieze.dyndns.org
ejabberd, the expandable Jabber daemon. --
http://ejabberd.jabber.ru/
More information about the Openstandaarden
mailing list