"TV Anytime might be a pain in the bum if you're writing a parser from
scratch. So don't - use one someone has already written!"
I assume you haven't tried doing it in PHP then :) I coded my own XML
parser in PHP a while ago (just as a challenge), and that works fairly
well to put the stuff in a database.
An extra month to make a prototype ... Just when I start being busy.
Should still have some time to add more to what I have just now at least.
Duncan
J.P.Knight wrote:
On Thu, 1 Sep 2005, Ben Metcalfe wrote:
There is an open source Java parser for TV-Anytime
(http://www.bbc.co.uk/opensource/projects/tv_anytime_api/) but I'm aware
many of you are not building your prototypes in Java.
Its probably worth pointing out that CPAN also has a TV::Anytime set
of modules for Perl. Handy for those of us that are Perl hackers and
don't do Java!
After reading all the stuff in the last few postings, I wondered just
how tricky TV Anytime format is to process if you can grok Perl and
have this module loaded. So after a few minutes with `perl -MCPAN -e
shell` doing an "install TV::Anytime" and loading all the
dependencies, I had Perl setup and ready to go. What to do? For a
simple test I simply strung together some of the TV::Anytime perldoc
examples with a quick bit of code to let me search through this weeks
TV::Anytime listings for TV programs that have keywords matching my
two major hobbies.
I've attached the resulting Perl code to this email, along with a
sample output. Its lacking comments, user interfaces or indeed any
useful
(though I did consider a cronjob to get the TVAnytime data at the
start of the week and then email me the matching list), but at least
it shows what is possible with a minimal amount of Perl hacking.
Its not big and its not clever but then the whole thing from the first
"what's this TV Anytime format look like anyway?" thought to writing
this email took just over two hours. I doubt Ben Metcalfe and the
chaps at BBC Backstage will allow this as an entry in the comp (and it
wasn't intended as one, though I'll take the prize if the rest of you
can't get your arses into gear! ;-) ) but folk can feel free to take
it, expand it, mull it over, hack it and generally do what you want
with it.
TV Anytime might be a pain in the bum if you're writing a parser from
scratch. So don't - use one someone has already written! A big round
of applause is due to Leon Brocard for creating TV::Anytime - it does
what it says on the tin and makes things really easy. So get to it
folks...
Jim'll
-
Sent via the backstage.bbc.co.uk discussion group. To unsubscribe, please
visit http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.
Unofficial list archive: http://www.mail-archive.com/backstage@lists.bbc.co.uk/