en.opensuse.org

The final (for now)

There was way to much clutter on the page from tv.be so I wanted to cut that out. And while I was it, why not have the channels I see on that page clickable so it will change the channel.

There are several steps to take. Get the site, change the layout. Change the links. Insert all the extra channels. Using it. Future things to do.

To get the site, Linux has a nice program called curl. Curl is able to handle a site from CLI. First I checked the site with Lynx to see if there was no strange Java stuff that could be making things extra hard. I also used it to save the cookies in the file /srv/www/vhost/local/tv/.cookies.tv.be and it looks like this. Obviously the auth key is not correct.

www.tv.be  FALSE  /  FALSE  1287865105	auth	      jsdb8sb8sbsdbsdssdsdbsdb6sossd
www.tv.be  FALSE  /  FALSE  1289247528	channelgroup  1
The number 1287865105 is the time that the cookie will expire, so best change those two to something like 9999999999 which is end 2286. After that best refresh the cookie.
The whole process to get the site is the following
#!/bin/bash
URL="http://www.tv.be/tv-gids?orientation=horizontal"
DIR=/srv/www/vhost/local/tv
FILE=$DIR/gids.php
COOKIES="$DIR/.cookies.tv.be"
curl -b $COOKIES -s $URL > $FILE
This should be getting the page. See that you have the cookies first, otherwise it will not get the correct page. To check this you can not open it at a file as it is php, so you must have Apache running and go to (in my case) http://local/tv/gids.php to see if you are indeed logged in.

If this is not working, then there is an issue with the cookies. Repair that first before you go on. Do not go on if this does not work.. It also shows how to get other sites to your personal webspace.

Do NOT use it to copy sites to make public. That is a big nono. So now you have the file locally and you can start to do whatever with it.

Next page