en.opensuse.org

More links

There are only a few chanels I want to see, but I would like to still be able to switch the program to it. So I just include them.

The biggest challege here was to find out where to place it so it would still be visable and looked ok.Once I found that, inserting it was not that hard after some help from Usenet. The script complete script can be seen below. This does NOT include the cookies file I descripbed earlier.

All of this might not usable for you, but it might be the basis of more and better things that you would be able to do and use it for. It was fun to do and I now can change the channel from the information page that I have.

#!/bin/bash
# Change radio stations
#set -x

#Parameters
TMP=`mktemp`
trap "rm -rf $TMP*" 0 1 2 3 5 6 9 14 15
URL="http://www.tv.be/tv-gids?orientation=horizontal"
DIR=/srv/www/vhost/local/tv
FILE=$DIR/gids.php
COOKIES="$DIR/.cookies.tv.be"
#URL_LOCAL=http://local/tv/gids.php

#Get the files with the apropriate cookies.
curl -b $COOKIES -s $URL > $FILE
dos2unix -q $FILE
#Change the CSS so it won't show anything that disturbes you
cat > $TMP << EOF
<style type="text/css">
.footer { display: none !important; }
.crosslinks { display: none !important;}
.sites { display: none !important;}
.button_zenders_kiezen{ display: none !important;}
.curved {display: none !important;}
.datum {display: none !important;}
h3{ display: none !important;}
.insert{ display: none !important;}
.hgrid{ background-image: none;}
</style>
EOF
awk "/\[if IE\]/{system(\"cat $TMP\")};1" $FILE > $TMP.cat
mv $TMP.cat $FILE

#####Get things changed
# CHange the channels
sed -i 's#/zenders/een?#?c=495.25\&#g' $FILE
sed -i 's#/zenders/ketnetcanvas?#?c=615.25\&#g' $FILE
sed -i 's#/zenders/vtm?#?c=479.25\&#g' $FILE
sed -i 's#/zenders/2be?#?c=487.25\&#g' $FILE
sed -i 's#/zenders/vt4?#?c=245.25\&#g' $FILE
sed -i 's#/zenders/vijftv?#?c=182.25\&#g' $FILE
sed -i 's#/zenders/bbc-1?#?c=259.25\&#g' $FILE
sed -i 's#/zenders/bbc-2?#?c=711.25\&#g' $FILE
sed -i 's#/zenders/discovery-vl?#?c=463.25\&#g' $FILE
sed -i 's#/zenders/nat-geo?#?c=189.25\&#g' $FILE
sed -i 's#/zenders/vitaya?#?c=719.25\&#g' $FILE


# Open programs in a seperate window
sed -i 's/title=""/title="" target="tv"/g' $FILE
sed -i 's#href="/#href="http://www.tv.be/#g' $FILE

#Add the php channel change part
sed -i 1i"<?php\n\$data=\$_GET['c'];\nif(\$data) exec(\"/usr/bin/ivtv-tune --device=/dev/video0 -teurope-west -f \$data\");\n?>" $FILE

#Right after <div class="content">
cat > $TMP << EOF
<table>
<tr>
<td width="125">
<a href="?c=495.25">Een</a><br>
<a href="?c=615.25">Ketnet/Canvas</a><br>
<a href="?c=479.25">vtm</a><br>
<a href="?c=487.25">2BE</a><br>
<a href="?c=245.25">VT4</a><br>
</td>
<td width="125">
<a href="?c=182.25">vijfTV</a><br>
<a href="?c=259.25">BBC One</a><br>
<a href="?c=711.25">BBC Two</a><br>
<a href="?c=463.25">Discovery</a><br>
<a href="?c=189.25">National Geo</a><br>
</td>
<td width="125">
<a href="?c=719.25">Vitaya</a><br>
<a href="?c=273.25">JIM</a><br>
<a href="?c=655.25">TMF</a><br>
<a href="?c=280.25">Disney</a><br>
<a href="?c=168.25">MTV</a><br>
</td>
<td width="125">
<a href="?c=203.25">Nederland 1</a><br>
<a href="?c=217.25">Nederland 2</a><br>
<a href="?c=695.25">Nederland 3</a><br>
<a href="?c=231.25">BBC World News</a><br>
<a href="?c=238.25">EuroNews (E/F)</a><br>
</td>
<td width="125">
<a href="?c=663.25">telenet INFO</a><br>
<a href="?c=527.25">Life!TV</a><br>
<a href="?c=535.25">Actua TV</a><br>
<a href="?c=196.25">EXQI Plus</a><br>
<a href="?c=735.25">Liberty TV</a><br>
</td>
<td width="125">
<a href="?c=815.25">Stories</a><br>
<a href="?c=679.25">ROB</a><br>
<a href="?c=133.25">ZDF</a><br>
<a href="?c=161.25">La Une</a><br>
<a href="?c=647.25">La Deux</a><br>
</td>
<td width="125">
<a href="?c=140.25">Arte Belgique</a><br>
<a href="?c=175.25">TF1</a><br>
<a href="?c=456.25">France 2</a><br>
<a href="?c=759.25">France 3</a><br>
<a href="?c=567.25">TVE</a><br>
</td>
<td width="125">
<a href="?c=727.25">RTL-TVi</a><br>
<a href="?c=775.25">Rai Uno</a><br>
<a href="?c=791.25">RTP</a><br>
<a href="?c=799.25">CNN</a><br>
<a href="?c=583.25">TEST</a><br>
</td>
</tr>
</table>
<p>
EOF

awk "/\"datum\"/{system(\"cat $TMP\")};1" $FILE > $TMP.cat
mv $TMP.cat $FILE

exit

Next page