Support:
Troubleshooting
FAQs
DivX Pro™ FAQs
Bulletin Board
System Requirements
DVD decoders
Capture Cards
Codecs
Installing Drivers
Remote Controls
Infrared Transmitters
Knowledgebase
Glossary
Screenshots


Download Showshifter Trial Version
Download Showshifter
15 Day Free Trial



Buy Showshifter
Buy
Showshifter

Buy the full version of Showshifter and unlock your current trial version.

The information contained in this document applies to ShowShifter versions before 3.10. You are strongly encouraged to upgrade for all these reasons.

Bring your own data: how to import XMLTV programme guide data in to ShowGuide

XMLTV, available from http://sourceforge.net/project/showfiles.php?group_id=39046, is a collection of utilities to collect electronic programme guide data from websites and store it locally in a well defined xml format. At the time of writing it supports the following countries: Canada, the USA, the UK, Germany, Austria, Sweden, Norway, Finland, New Zealand, Spain, Italy, the Netherlands, Hungary, and Denmark. The list of supported countries is always expanding, so check out their website for any additional countries which might be supported.

Download XMLTV and read the documentation

Grab the latest windows binary (xmltv-x.x.xx-win32.zip) from their website, and unzip it into a convenient location on your computer, let's assume that you unzip the file to c:\xmltv, to keep things simple. It really doesn't matter where you put it. Now is the time to read all the documentation that came with XMLTV.

Configure XMLTV

Open a DOS (Command) box in windows. You'll find the shortcut on the accessories menu on the Start menu. Navigate to c:\xmltv (or wherever you unzipped it) and configure your channel package according to the XMLTV documentation. For the UK you would type:
xmltv.exe tv_grab_uk_rt --configure
And follow the onscreen instructions. For other countries you would use the appropriate tv_grab_xx parameter.

Run XMLTV

Once the configure stage is completed, it's time to get some real data. In the same command prompt as before, type:
xmltv.exe tv_grab_uk_rt >listings.xml
This might take a while to finish, depending on the number of channels you're grabbing and the speed of your connection to the internet. Once it has completed, you should find a file called 'listings.xml' sitting next to xmltv.exe. Obviously, this file now contains the tv listings in xml format.

Import the data into ShowGuide

We've created a small utility, called HMNXMLTV.exe (instructions here), which uses the Expat XML parser library (http://www.libexpat.org) to process the xml data. All you have to do is to download the utility (http://www.inventv.com/download/hmnxmltv.zip), unzip it in the same directory as ShowShifter (C:\Program Files\Home Media Networks Limited\ShowShifter), exit ShowShifter if it is running and run the utility hmnxmltv.exe. It will ask you for the location of the listings.xml file, and once you've done that it will process the xml file and import it into ShowGuide for you. This could take a while and at times it may appear to hang, but just leave it be and let it run its course.
More general information on the ShowGuide format and how to import data into it can be found here: 'Bring your own data: how to import data into ShowGuide'.

Reorder the channels in your preferred order

Everytime you run HMNXMLTV.exe it will create a file called 'channels.txt', containing all the channels one per line found in the listings.xml file, sorted alphabetically by their internal name. Once you have this file, open it in a text editor and reorder the lines according to your preferences. The next time you run HMNXMLTV.exe specify '/s:channels.txt' on the commandline. HMNXMLTV.exe will now use this file instead of creating it and add the channels in the order found in the channels.txt file. Channels that are not matched will be added at the end. The first time you do this, you will also need to use the /c option to remove any listings that are still in the old order, e.g. '/c /s:channels.txt'.

View data in ShowGuide

Now start up ShowShifter again and click on the 'ShowGuide' button. You should be able to view and search your listings now.

Automatic updates of your data

It would really be more usefull if you could somehow automatically update your listings, for instance in the middle of the night when you're asleep and not using your computer otherwise. The easiest would be to use a batch file, a plain text file with DOS commands, one per line. Something like this would probably do the trick:
pushd c:\xmltv

if exist started.at goto already_running
time /t >started.at
date /t >>started.at
 
del listings.xml
xmltv.exe tv_grab_uk_rt >c:\xmltv\listings.xml
if ERRORLEVEL 2 goto no_data_downloaded

"C:\Program Files\Home Media Networks Limited\ShowShifter\HMNXMLTV.exe" /c c:\xmltv\listings.xml

:no_data_downloaded
del started.at

:already_running
popd
Save these lines as 'c:\xmltv\update.bat' and run it every night from within ShowShifter in the ShowGuide update settings. When you set it up from within ShowShifter, then ShowGuide will properly release the database before running the batch file and re-open it afterwards. If you don't run it from within ShowShifter then the script will not be able to open the database. The line 'if exist started.at goto already_running' prevents multiple instances of the script from running at the same time. The line 'if ERRORLEVEL 2 goto no_data_downloaded' prevents a valid existing database from being overwritten when something fails trying to download new data.

Recommendation

Websites tend to change their data format often, so it is important to keep up to date with the XMLTV releases. The XMLTV developer community is normally quick to fix any changes or problems, so to keep up to date subscribe to the xmltv-announce mailing list and you'll never miss an important update.

HMNXMLTV.exe instructions

When you run HMNXMLTV.exe with no command line options it will ask you for an xml file with xmltv data. It will then proceed to import this data into the ShowGuide database, removing old data from the database, and also removing any data which clashes with the new data. This utility supports a number of command line options to tune its behaviour:
HMNXMLTV.exe /x /c[:numdays] /o:numminutes /s:services_file xmltv_data_filename
or:
HMNXMLTV.exe /h
/x
Extract channel ids only to 'channels.txt'.
/c[:numdays]
Clean database. numdays is the optional number of days a show has to be older than to be deleted from the database. No numdays argument (/c) means delete the whole database. So a value of 2 for numdays (/c:2) will delete all shows from the database which took place 2 or more days in the past.
/o:numminutes
Offset all times by number of minutes. Adds numminutes to the start and end times of all programs.
/s:services_file
Ordered list of channel ids, one per line. The channel ids must match the channel ids from XMLTV to work. This field is usefull because XMLTV spits out the channels in channel id alphabetical order, which is most likely not your favourite order. You can reorder them using a plain text file with the ids in your preferred order. Any non-matching channels will just be added on to the end. If no file specified then just extract channel ids to 'channels.txt'.
xmltv_data_filename
The xml file containing the listings data in XMLTV format.
/h
Show a brief help message and exit.
Note 1:
Arguments in square brackets ([]) are optional. The square brackets themselves are not part of the command line.
Note 2:
The colon (:) immediately following the switches (e.g. '/s:services_file') are not part of any filename or path following it. It's there to separate the switch (/s) from its argument (services_file). So if your services_file is 'c:\xmltv\channels.txt' then the argument would look like this: /s:c:\xmltv\channels.txt.

References

The XMLTV website (http://membled.com/work/apps/xmltv/).
The XMLTV download site (http://sourceforge.net/project/showfiles.php?group_id=39046).
Subscribe to the xmltv-announce mailing list.
The import utility, HMNXMLTV.exe and support files. Get them from here.
The Expat XML parser library (http://www.libexpat.org).
Bring your own data: how to import data into ShowGuide.

 
     
Copyright© 2003 Home Media Networks Limited.
All rights reserved. ShowShift, ShowShifter, ShowShifter Pro and the ShowShift logo are all Trademarks of Home Media Networks Limited.
Click here to view our Privacy Policy