xmltv
view release on metacpan or search on metacpan
doc/QuickStart view on Meta::CPAN
The real point of getting a TV guide in machine-readable form is to
let the computer do the work of looking through it finding things for
you to watch. Two programs are distributed to do this. tv_check is a
GUI-based program where you select some shows and then generate a
printed report which flags any deviations from the normal weekly
schedule. tv_pick_cgi is a Web-based program which takes a different
approach: it shows you all the programmes that are on and asks what to
do with each one, then generates a personal TV guide with the shows
chosen. However preferences are remembered for the next run, so next
time you'll only be asked about new programmes.
See README.tv_check for instructions on using tv_check.
To use tv_pick_cgi, you will need an environment for running CGI
scripts. If you're lucky enough to have a web server handy, copy the
file as tv_pick.cgi to a directory somewhere, copy XMLTV.pm and the
XMLTV/ directory (which contains more Perl modules) to the same place,
and copy a listings file there as tv.xml. It is best for the listings
to be sorted.
If you have no web server, you can still run tv_pick_cgi using the
'CGI emulation' mode of the Lynx text-based web browser. Run 'lynx
lynxcgi:tv_pick_cgi'. This assumes your Lynx has the CGI emulation
compiled in - if not, suggest it to your vendor. Quick guide to Lynx:
move between radio buttons using up-arrow and down-arrow. Press
right-arrow to select a radio button, to press an on-screen button
like 'Submit' move the highlight to it and press Enter.
You should now be presented with a list of all programmes you haven't
seen before (on the first run, this will be everything). For each
programme there are four choices:
never - no, I don't want to watch it, and don't ask me about
programmes with this title ever again.
no - I won't watch it this time, but ask me again next time.
yes - I might watch it (put it in the output listings), but ask me
again next time.
always - whenever a programme with this title appears, always put it
in the output without asking.
The default option for unrecognized titles is 'never', reflecting the
fact that most things on TV are rubbish. Because something marked as
'never' is effectively censored from all future sessions with
tv_pick_cgi, you should be sure to change this for any programme you
might want to watch in the future. Saying 'no' is a safe choice for
things you don't want to watch.
when you've chosen your preferences for everything on the page, press
'Submit' and a page will appear confirming your preferences and
listing which of the programmes will appear in the output ('planning
to watch'). There will probably be several pages of listings, so go
to 'Next page' and repeat as necessary. Take comfort in the thought
that you'll never have to deal with most of these shows ever
again :-).
At the end a personal listings file towatch.xml is generated, which
you can download with your browser if you want, and your preferences
are stored for next time in the file tvprefs. It is worth checking
this file after your first use of pick_cgi in case you accidentally
marked something as 'never'.
* Using the tools together
It's probably easiest, once you get used to the tools, to run them
together in a pipeline. For example,
% tv_grab_fi | tv_sort | tv_extractinfo_en \
| tv_sort | tv_grep --on-after now >guide.xml
This gets listings, sorts them, munges them through
tv_extractinfo_en to see what it finds (in this case it will probably
break up 'Open University' into subprogrammes, among other things),
sorts again and filters out those programmes already missed. The
first sorting is needed to add stop times to programmes to give
tv_extractinfo_en the most information to work on; the second sorting
because tv_extractinfo_en does not necessarily produce fully sorted
output. Most of the XMLTV tools do not strictly require that the
input be sorted, but they tend to work a bit better if it is.
Then run 'tv_check --scan' or use tv_pick_cgi to generate a text
report or a personal TV listing.
( run in 0.795 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )