This is a Perl script that converts a sorted XML file made by XMLTV into a nicely formatted HTML TV guide. This is licensed under the GNU GPL.
See also PZSchedule, a Windows application that creates an HTML TV guide which allows users to click on the programs to record them. PZSchedules' HTML stuff is derived from tv2html.
Download
- Latest Development Version (might contain bugs!) tv2html.pl v0.1.1
- Latest Stable Version: tv2html.pl v0.0.4
- Older versions
- Themes (put these is the same directory as the generated HTML page)
- Example Page
- Change Log
- Licensing Information
Using tv2html.pl - An Example
tv_grab_uk --days 2 > tv-listings.xml tv_sorttv-listings-sorted.xml tv2html.pl tv-listings.html
Option Files
As of version 0.1.0, tv2html.pl now supports option files. It will read options from these files if they exist:
- /etc/tv2html.conf
- ~/.tv2html.conf
- ~/etc/tv2html.conf
- /etc/tv2html.important.conf
If a file doesn't exist, it will be ignored. If an option is set more than once, the last value applies. (The files are read in the order above, so the system administrator can over-ride any settings in /etc/tv2html.important.conf if he wants.
Here is an example /etc/tv2html.conf:
ChannelOrder london.bbc1.bbc.co.uk london.bbc2.bbc.co.uk carlton.com channel4.com channel5.co.uk ChannelHideUnordered 1 DisplayChannels Name DisplayChannels2 Name StyleByHTML 1 StyleByCSS 1 DisplayDescriptions 0
ChannelOrder specifies which order the columns should be in. It should use the channel IDs, which look like domain names. If you don't know what the channel IDs are, you should be able to find them by reading the XML file.
If you set ChannelHideUnordered to 1, it will leave any channels not explicitly specified in the ChannelOrder setting out of the end HTML file completely. If you set it to 0, they are put in the right-hand columns.
DisplayChannels controls how the headings for the channels are displayed at the top of the columns. You can set it to "Name", for example "BBC 1"; or to "Caption" in which case it displays the channel's logo plus the name as a caption; or to "Icon" in which case it just displays the logo; or to "ID" which is the old behaviour of just displaying the channel ID like "london.bbc1.bbc.co.uk"
DisplayChannels2 does the same, but effects the channels as they are displayed at the top of subsequent days (not the first day).
StyleByCSS can be set to 1 or 0. If set to 1, the HTML file will use CSS to set fonts, colours, etc.
StyleByHTML can be set to 1 or 0. If set to 1, the HTML file will use tags, etc to style the page. Note, that StyleByCSS and StyleByHTML can both be 1, or both be 0 if desired.
DisplayDescriptions can be 1 or 0. If set to 1, there will be plot summaries for TV shows.