XMLTV is a great project. Just look at the name, "XML-TV", it's like a combination of one of the most geeky technologies and one of the most common things on Earth. In a way, it brings your imagination close to that fantasy shared among all computer enthusiasts: the use of domotics and intelligent appliances to automate everything you need in your house. But let's keep our feet on the ground, XMLTV is only going to do one thing for you, it'll bring you the TV schedule, and it's not going to make you coffee right? With that in mind, let's have a closer look at it.
At present XMLTV can grab TV listings for the following regions: Australia, Belgium and Luxembourg, Brazil, Britain and Ireland, Denmark, Estonia, Finland, France, Germany, Hungary and Romania, Iceland, Italy, Japan, Netherlands, North America, Norway, Portugal, Reunion Island (France), South Africa, Spain, Sweden, and Switzerland.
If "xmltv" is not present in your distribution's repositories you can find the source code as well as RPM and DEB packages for it on the project's website: http://xmltv.org/wiki/
Once installed on your system, you can use the scripts to download the TV listings for the geographical region you're interested in. XMLTV provides a collection of scripts which name starts with "tv_". The most important scripts are the one called "tv_grab_" and they are suffixed with the name of the region. For instance the script which grabs the TV listings for the UK is called "tv_grab_uk_rt". These scripts download the listings from the Internet and output the result in XML.
Before you can use tv_grab, you need to configure it. In this article we'll assume you're interested in the UK region. In a terminal, type the following:
The script will present you the available TV channels from that region and you'll have to answer for each one whether or not you want to see the listings for this channel. Once you've gone through all the channels, it will save the configuration in ~/.xmltv/tv_grab_uk_rt.conf.
Once this is done, and tv_grab knows which channels you're interested in, you can use it to download the listings and save them as an XML file:
tv_grab_uk_rt > tv.xml
The resulting XML file contains your TV schedule in XMLTV format. All you need now is a GUI application to show you that data in a nice and pleasant way.
There are a few GUI applications on the Internet which are able to read XMLTV files. One of them is Maxemum TV-Guide (MTVG), which you can download as a TGZ archive, an RPM or DEB package from here: http://mtvg.sourceforge.net/
MTVG is developed in C++, based on Qt and it is the perfect solution if you use KDE. Alternatively, if you're using Gnome you can have a look at another XMLTV GUI application called OnTV: http://johan.svedberg.com/projects/coding/ontv/
Once you've installed and run MTVG you should see a screen like this one:
Press the "Preferences" button and fill the "Update" section to tell MTVG where to find the XML file and how to update its content:
As you can see in the above screenshots, you can tell tv_grab to run in quiet mode (for debug information not to be shown). Also, if you use the --days option you can tell tv_grab to only get the listings for a certain number of days. By default, tv_grab gets as much information as it can from its Internet source, so updates will be faster if you specify a number of days. Finally, check the "Auto Update" option to tell MTVG to update the listing automatically.
Press "Done", and "Update Now...". Once MTVG has finished updating the listings, the information appears on the screen:
By clicking on the adequate column you can sort the listings by time, title or channel. If you select an item, you'll see its description in the bottom pane. The two right panes allow you to filter by type of programs and by channel.
MTVG is also full of nice little features. For instance, it shows you which programs are already started and how long you have left until they finish. For instance, in the above screenshot, the "RTE Racing" program is 40% finished and there's only 1h33 left of it.
You can also search for programs and add them in your "favorite" list. When one of your "favorite" program is about to start MTVG notifies you with a popup dialog box or by running a command of your choice.
MTVG and XMLTV represent the perfect solution to get an updated TV schedule under Linux. It's fast, it's easy to configure and thanks to MTVG it's easy to browse and to use. You get notified for things you don't want to miss, the listings get updated automatically and, thanks to the way KDE sessions work, you can just take advantage of the MTVG system tray icon, have the application always run in the background and never think of it until you need it.