Author: | Til Schneider |
Translated by: | Lena Pammer |
This is part III of the tutorial about providing tv listings. It assumes that you have successfully completed parts I and II. We will use the same tools as in these parts.
In part I. we used a Java program to retrieve the tv listings from the source (this program was called a PrimaryDataService or PDS). During part II, we entered the lsitings manually. This part of the tutorial is aimed at those who want to write a program for collecting tv listings that is implemented in a different programming language.
Processing the tv listings with a non-Java-collector happens in two stages:
Because we will work on a complete xml file and focus on the second stage, no knowledge about programming will be necessary for this part of the tutorial.
THe manner of generating the xml file is the sole responsibility of the person programming the listings collector. If you must, you may also manually generate the file. But as mentioned, the tutorial comes with a complete xml file, which we will use.
We will use the xml format XMLTV. Some parts of the tv listings are not supported by XMLTV; for these parts, the format was extended somewhat. If you do not need the additional elements, you can simply use valid XMLTV for your listings files.
TvData.xml is the file that the listings collector should overwrite. It contains all the tv listings.
Now we open TvData.xml in a text editor. The file contains a <programme>
The first tag in this example contains a describing comment before each subtag. It contains all information tags that can be specified for a program. But don't despair: You need not fill all the subtags for each programs (though you can). All you really have to add is marked by the text (required) in the description: These subtags are the channel ID, the start time and the title of the program.
A minimal tag for a program might for example be:
<programme channel="test24_ch" start="200407101100"> <title>News</title> </programme>
The channel ID consists of two parts: the ID itself and the country code (already described in part II).
All times have the following format according to XMLTV:
Hence, 200407101100 means: July 10, 2004 at 11:00.
Right now, TvData.xml contains few programs. You can add a few programs yourself, so that there will be more to see later on. Just make sure that the channel IDs you use are among those defined in [GROUPID]_channels.txt (in the config folder)!
When you feel there are enough programs for now, save the file.
Now we can start our first test run. Just like in parts I and II, we invoke PDSRunner with the command
pdsrunner XmlTvPDS
If any errors occurred, the error messages can be found in the pdslog folder as usual. Otherwise, the raw listings have been written to the raw folder. The listings need to be processed by DataManager and can then be uploaaded by MirrorUpdater. However, these two tools must first be configured. The procedure is the same as the one described in part II, Configuring DataManager and MirrorUpdater. The only difference is that we use XmlTvPDS instead of ExcelPDS.
As always, you must take care to regularly update the listings on your server. Every time you want to update the listings, you run the listings collector, which will generate a new version of TvData.xml. After that, you invoke the TV-Browser tools:
pdsrunner XmlTvPDS datamanager [GROUPID] mirrorupdater mirrorupdater.ini
Important note: To avoid that TV-Browser loads listings from servers that contain outdated listings, the MirrorUpdater stores a file named lastupdate on each server.
TV-Browser will not use servers that have not been updated for more than five days. Hence, a listings provider has to update his servers at least every five days.
DataManager requires the files in the prepared folder to determine the changes that were made to the listings. For this reason, you must not remove files from the prepared folder.
If files were removed from the prepared folder, the listings would no longer be the same as those that the user has already downloaded. As a consequence, TV-Browser would not realize that the listings for that day and channel have changed and would never download the new listings.
Back to part II | Overview |