Wordpress Themes

A place for my programming projects and the occasional blog about technology related matters.

Danish TV Guide

Author einar

I’ve been living in Denmark for the past year as I study for my Masters in Computer Science at DTU. In my danish apartment I get a few danish, swedish and norwegian tv stations. I was getting tired of flipping through them at night and looking at the teletext for each of them to figure out if anything good was on, so I thought it would be nice to have my very own tv guide for exactly the stations I had available. And, being a big nerd, I decided to do something about it!

I’ve done a bit of screen scraping in Python but this was the first time I used the excellent Beautiful Soup library. It makes screen scraping a thousand times easier and handles badly formed html very well. So, I created a small script that screen scraped the tv listings for the stations I watch, and then spit out my own personal tv guide where the listings are aligned by time so I can quickly see for a given hour exactly what is on tv on all the stations. The script is simple, it has a base class TVListing and then a few different subclasses for different stations. Fortunately a few of them use the same format so I didn’t have to do a class for each station. It would be easy to customize this to add more stations or re-order them or whatever. The output from the script can be viewed here and it can be downloaded here or viewed syntax highlighted here.

Reader's Comments

  1. Atli |

    Nörd! :)

  2. Peter Valdemar Mørch |

    Being a dane, may I ask you if you know about the Xmltv project?

    As a derived project, there is a site dedicated to the production of XML output for danish tv line ups with all the bells and whistles of a TV guide.

    http://niels.dybdahl.dk/xmltvdk/index.php/Forside

    Peter

  3. einar |

    Thanks for letting me know. That looks like something I could use instead of my own hack :)

CommentComment

For spam filtering purposes, please copy the number 3795 to the field below: