Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

davorg (18)

davorg
  dave@dave.org.uk
http://dave.org.uk/
Yahoo! ID: daveorguk (Add User, Send Message)

Hacker, author, trainer

Technorati Profile [technorati.com]

Journal of davorg (18)

Wednesday July 21, 2004
11:59 AM

Who Needs Accessible Odeon

[ #19977 ]

...when you have WWW::Odeon.

I was playing with something along these lines, but it looks like Iain beat me to it. Which is cool. He can deal with the lawyers instead of me :)

Here's a sample program.

#!/usr/bin/perl

use strict;
use warnings;

use WWW::Odeon;

my $cinema = shift || 'Streatham';

my $details = get_details($cinema);

foreach my $date (sort by_date keys %$details) {
  print "$date\n";

  foreach my $film (sort keys %{$details->{$date}}) {
    print "$film - ";
    print join ',', sort keys %{$details->{$date}{$film}};
    print "\n";
  }
  print "\n";
}

sub by_date {
  my @a = $a =~ m|(\d+)/(\d+)/(\d+)|;
  my @b = $b =~ m|(\d+)/(\d+)/(\d+)|;

  $a[2] <=> $b[2] || $a[1] <=> $b[1] || $a[0] <=> $b[0];
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I think web scrapping the Odeon website is not a problem. The problem would be (or was) turning a webscrapping script into a CGI that's available to everyone (and that Odeon users might take for Odeon's original site).

    So, as long as you can do whatever you want with the data you downloaded from the website, why not go for the web proxy option?

    use HTTP::Proxy;
    use HTTP::Proxy::BodyFilter::Odeon; # coding this module is left as an exercise for the reader ;-)

    my $proxy = HTTP::Proxy->new;
    $proxy->push_f