XMLTV to XHTML+RDFa

The XMLTV format is designed for storing TV listings in XML. It was originally created by my co-aulmni Ed Avis at Imperial College.

This script converts an XMLTV file into a set of XHTML files displaying the TV listings sorted by time and date, by genre and by channel. Whatsmore, the XHTML is marked up using RDFa which allows the data to be parsed and handled by RDF tools.

You probably want to use this script as part of a tool chain including XMLTV grabbers and tv_grep . I use it as part of the following script, run automatically at 6 am every day:

#!/bin/sh DIR=/home/tai/public_html/vhosts/goddamn.co.uk/tv tv_grab_uk_rt --days 2 >$DIR/tv.xmltv tv_grab_uk_bbcbackstage >$DIR/radio.xmltv tv_cat $DIR/tv.xmltv $DIR/radio.xmltv >$DIR/all.xmltv tv_grep \ --on-after `date -Is -d "6am today"` \ --on-before `date -Is -d "6am tomorrow"` \ <$DIR/all.xmltv \ >$DIR/today.xmltv rm -f $DIR/*.html /home/tai/bin/xmltv2xhtml.pl \ --d_fmt='%A' \ --target-directory=$DIR/ \ $DIR/today.xmltv